From a6c71ce5d2d2fe89e07a2ef5041c915acc3dc686 Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Mon, 28 Mar 2011 19:21:28 +0300 Subject: [PATCH] os: fix memory and fd leaks in Popen Signed-off-by: Tiago Vignatti Reviewed-by: Peter Hutterer Reviewed-by: Nicolas Peninguy --- os/utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/os/utils.c b/os/utils.c index f47177f4f..36cb46f11 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1315,6 +1315,9 @@ Popen(char *command, char *type) /* Ignore the smart scheduler while this is going on */ old_alarm = OsSignal(SIGALRM, SIG_IGN); if (old_alarm == SIG_ERR) { + close(pdes[0]); + close(pdes[1]); + free(cur); perror("signal"); return NULL; }