aboutsummaryrefslogtreecommitdiff
path: root/lib/src/delsrv.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-02-25 14:33:19 +0100
committerDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-03-24 17:04:20 +0100
commit9a88f7da453eadc72d8f333700dbd80777feecd1 (patch)
tree8a096e37123ece1d20bcb4d0ae8e064bdd39747a /lib/src/delsrv.c
Initial commit
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Diffstat (limited to 'lib/src/delsrv.c')
-rw-r--r--lib/src/delsrv.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/src/delsrv.c b/lib/src/delsrv.c
new file mode 100644
index 0000000..b660558
--- /dev/null
+++ b/lib/src/delsrv.c
@@ -0,0 +1,25 @@
+#include <stdlib.h>
+
+#include "service.h"
+
+void delsrv(service_t *srv)
+{
+ size_t i;
+
+ for (i = 0; i < srv->num_exec; ++i)
+ free(srv->exec[i]);
+
+ for (i = 0; i < srv->num_before; ++i)
+ free(srv->before[i]);
+
+ for (i = 0; i < srv->num_after; ++i)
+ free(srv->after[i]);
+
+ free(srv->before);
+ free(srv->after);
+ free(srv->name);
+ free(srv->desc);
+ free(srv->exec);
+ free(srv->ctty);
+ free(srv);
+}