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>
This commit is contained in:
Tiago Vignatti 2011-03-28 19:21:28 +03:00
parent bafec9a25e
commit a6c71ce5d2

View File

@ -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;
}