diff --git a/src/collectdmon.c b/src/collectdmon.c
index 6c50cf12509084f4958958261734bbcd6172ed9f..33f02b45694d889d07613a05110230c1b32d7442 100644 (file)
--- a/src/collectdmon.c
+++ b/src/collectdmon.c
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;
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;
}
if (0 != sigaction (SIGHUP, &sa, NULL)) {
syslog (LOG_ERR, "Error: sigaction() failed: %s", strerror (errno));
+ free (collectd_argv);
return 1;
}