aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2018-06-27 17:37:11 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2018-06-27 17:37:11 -0500
commit56ddda54b5aa01474bf563d5a662075c35152858 (patch)
tree5c6e0bd5db6098caedf0a332a613b76d54a1e836
parent3a803b3135837665d51ef4dd7a8b913c78e71ff6 (diff)
supervise-daemon.c: clean up memory leaks
-rw-r--r--src/rc/supervise-daemon.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index 60bd1f20..8d56b8d4 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -860,10 +860,13 @@ int main(int argc, char **argv)
varbuf = NULL;
xasprintf(&varbuf, "%i", respawn_delay);
rc_service_value_set(svcname, "respawn_delay", varbuf);
+ free(varbuf);
xasprintf(&varbuf, "%i", respawn_max);
rc_service_value_set(svcname, "respawn_max", varbuf);
+ free(varbuf);
xasprintf(&varbuf, "%i", respawn_period);
rc_service_value_set(svcname, "respawn_period", varbuf);
+ free(varbuf);
child_pid = fork();
if (child_pid == -1)
eerrorx("%s: fork: %s", applet, strerror(errno));
@@ -891,6 +894,7 @@ int main(int argc, char **argv)
}
xasprintf(&varbuf, "%d", x);
rc_service_value_set(svcname, "argc", varbuf);
+ free(varbuf);
rc_service_value_set(svcname, "exec", exec);
supervisor(exec, argv);
} else