From 7970eb6191de2ff6f98a4d8cab73b55dd1d4b541 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sun, 27 Jan 2008 23:26:41 +0100 Subject: [PATCH] exec plugin: Fixed a possible (though very improbable) memory leak. In case of an error, the program_list_and_notification_t pointer has not been freed before calling pthread_exit() from exec_notification_one(). Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- src/exec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } -- 2.11.0