X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fexec.c;h=d5a8d0fd57562cd292f2156c42130da48f803dbe;hb=a00feb12d82ae2f46db99d0336b955f387f7f354;hp=e7648bd7f3f66e7be405dd4042e8cf0d839b9b38;hpb=f59c94bac0b78d0ce4d53d39c84a88d0b6e5390a;p=collectd.git diff --git a/src/exec.c b/src/exec.c index e7648bd7..d5a8d0fd 100644 --- a/src/exec.c +++ b/src/exec.c @@ -581,8 +581,10 @@ static void *exec_notification_one (void *arg) /* {{{ */ const char *severity; pid = fork_child (pl, &fd, NULL); - if (pid < 0) + if (pid < 0) { + sfree (arg); pthread_exit ((void *) 1); + } fh = fdopen (fd, "w"); if (fh == NULL) @@ -593,6 +595,7 @@ static void *exec_notification_one (void *arg) /* {{{ */ kill (pl->pid, SIGTERM); pl->pid = 0; close (fd); + sfree (arg); pthread_exit ((void *) 1); }