X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fexec.c;h=d5a8d0fd57562cd292f2156c42130da48f803dbe;hb=a00feb12d82ae2f46db99d0336b955f387f7f354;hp=715e3c68525ae4b0576bfc1580722e61003abbae;hpb=4b1b102eadc1a21e5be79b91410240acb40a3e73;p=collectd.git diff --git a/src/exec.c b/src/exec.c index 715e3c68..d5a8d0fd 100644 --- a/src/exec.c +++ b/src/exec.c @@ -1,6 +1,6 @@ /** * collectd - src/exec.c - * Copyright (C) 2007 Florian octo Forster + * Copyright (C) 2007,2008 Florian octo Forster * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -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); }