summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Vignatti <tiago.vignatti@nokia.com>2011-03-28 16:21:28 (GMT)
committerTiago Vignatti <tiago.vignatti@nokia.com>2011-04-04 12:41:47 (GMT)
commita6c71ce5d2d2fe89e07a2ef5041c915acc3dc686 (patch)
treeb70416b34417fbed2f9d4f0901959f4ca67b71e7
parentbafec9a25efa902bef2a3730dc44dc50f0e45877 (diff)
os: fix memory and fd leaks in Popen
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org>
-rw-r--r--os/utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/os/utils.c b/os/utils.c
index f47177f..36cb46f 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;
}