diff options
author | Tiago Vignatti <tiago.vignatti@nokia.com> | 2011-03-28 19:21:28 +0300 |
---|---|---|
committer | Tiago Vignatti <tiago.vignatti@nokia.com> | 2011-04-04 15:41:47 +0300 |
commit | a6c71ce5d2d2fe89e07a2ef5041c915acc3dc686 (patch) | |
tree | b70416b34417fbed2f9d4f0901959f4ca67b71e7 | |
parent | bafec9a25efa902bef2a3730dc44dc50f0e45877 (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.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) | |||
1315 | /* Ignore the smart scheduler while this is going on */ | 1315 | /* Ignore the smart scheduler while this is going on */ |
1316 | old_alarm = OsSignal(SIGALRM, SIG_IGN); | 1316 | old_alarm = OsSignal(SIGALRM, SIG_IGN); |
1317 | if (old_alarm == SIG_ERR) { | 1317 | if (old_alarm == SIG_ERR) { |
1318 | close(pdes[0]); | ||
1319 | close(pdes[1]); | ||
1320 | free(cur); | ||
1318 | perror("signal"); | 1321 | perror("signal"); |
1319 | return NULL; | 1322 | return NULL; |
1320 | } | 1323 | } |