2018-11-23 13:13:23 +01:00
|
|
|
/* SPDX-License-Identifier: ISC */
|
2018-02-25 14:33:19 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "service.h"
|
|
|
|
|
2018-03-25 12:14:06 +02:00
|
|
|
void delsvc(service_t *svc)
|
2018-02-25 14:33:19 +01:00
|
|
|
{
|
2018-04-04 14:58:01 +02:00
|
|
|
exec_t *e;
|
2018-02-25 14:33:19 +01:00
|
|
|
|
2018-04-08 13:30:20 +02:00
|
|
|
if (svc == NULL)
|
|
|
|
return;
|
|
|
|
|
2018-04-04 14:58:01 +02:00
|
|
|
while (svc->exec != NULL) {
|
|
|
|
e = svc->exec;
|
|
|
|
svc->exec = e->next;
|
2018-02-25 14:33:19 +01:00
|
|
|
|
2018-04-04 14:58:01 +02:00
|
|
|
free(e);
|
|
|
|
}
|
2018-02-25 14:33:19 +01:00
|
|
|
|
2018-03-25 12:14:06 +02:00
|
|
|
free(svc->before);
|
|
|
|
free(svc->after);
|
2018-04-21 22:19:43 +02:00
|
|
|
free(svc->fname);
|
2018-03-25 12:14:06 +02:00
|
|
|
free(svc->desc);
|
|
|
|
free(svc->exec);
|
|
|
|
free(svc->ctty);
|
|
|
|
free(svc);
|
2018-02-25 14:33:19 +01:00
|
|
|
}
|