summaryrefslogtreecommitdiff
path: root/lib/src/delsrv.c
diff options
context:
space:
mode:
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);
+}