summaryrefslogtreecommitdiff
path: root/lib/src/delsvc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/src/delsvc.c')
-rw-r--r--lib/src/delsvc.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/src/delsvc.c b/lib/src/delsvc.c
index 3e077fb..7370653 100644
--- a/lib/src/delsvc.c
+++ b/lib/src/delsvc.c
@@ -21,16 +21,19 @@
void delsvc(service_t *svc)
{
- size_t i;
+ exec_t *e;
- for (i = 0; i < svc->num_exec; ++i)
- free(svc->exec[i]);
+ while (svc->exec != NULL) {
+ e = svc->exec;
+ svc->exec = e->next;
- for (i = 0; i < svc->num_before; ++i)
- free(svc->before[i]);
+ free(e->argv);
+ free(e->raw_argv);
+ free(e);
+ }
- for (i = 0; i < svc->num_after; ++i)
- free(svc->after[i]);
+ free(svc->raw_before);
+ free(svc->raw_after);
free(svc->before);
free(svc->after);