From: Florian Forster Date: Fri, 19 Jun 2015 08:54:02 +0000 (+0200) Subject: collectdmon: Fix memory leak. X-Git-Tag: collectd-5.5.1~68^2~34 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=49bd12d05d940a4e4b129c29e56599a8098f2164;p=collectd.git collectdmon: Fix memory leak. --- diff --git a/src/collectdmon.c b/src/collectdmon.c index 078b2eb1..c81ca3f4 100644 --- a/src/collectdmon.c +++ b/src/collectdmon.c @@ -312,7 +312,10 @@ int main (int argc, char **argv) openlog ("collectdmon", LOG_CONS | LOG_PID, LOG_DAEMON); if (-1 == daemonize ()) + { + free (collectd_argv); return 1; + } sa.sa_handler = sig_int_term_handler; sa.sa_flags = 0; @@ -320,11 +323,13 @@ int main (int argc, char **argv) if (0 != sigaction (SIGINT, &sa, NULL)) { syslog (LOG_ERR, "Error: sigaction() failed: %s", strerror (errno)); + free (collectd_argv); return 1; } if (0 != sigaction (SIGTERM, &sa, NULL)) { syslog (LOG_ERR, "Error: sigaction() failed: %s", strerror (errno)); + free (collectd_argv); return 1; } @@ -332,6 +337,7 @@ int main (int argc, char **argv) if (0 != sigaction (SIGHUP, &sa, NULL)) { syslog (LOG_ERR, "Error: sigaction() failed: %s", strerror (errno)); + free (collectd_argv); return 1; }