summaryrefslogtreecommitdiff
path: root/lib/init/delsvc.c
blob: f453db6fbce53adebd11844be9e35bab62df1854 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* SPDX-License-Identifier: ISC */
#include <stdlib.h>

#include "service.h"

void delsvc(service_t *svc)
{
	exec_t *e;

	if (svc == NULL)
		return;

	while (svc->exec != NULL) {
		e = svc->exec;
		svc->exec = e->next;

		free(e);
	}

	free(svc->before);
	free(svc->after);
	free(svc->fname);
	free(svc->desc);
	free(svc->exec);
	free(svc->ctty);
	free(svc);
}