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:
parent
bafec9a25e
commit
a6c71ce5d2
|
@ -1315,6 +1315,9 @@ Popen(char *command, char *type)
|
||||||
/* Ignore the smart scheduler while this is going on */
|
/* Ignore the smart scheduler while this is going on */
|
||||||
old_alarm = OsSignal(SIGALRM, SIG_IGN);
|
old_alarm = OsSignal(SIGALRM, SIG_IGN);
|
||||||
if (old_alarm == SIG_ERR) {
|
if (old_alarm == SIG_ERR) {
|
||||||
|
close(pdes[0]);
|
||||||
|
close(pdes[1]);
|
||||||
|
free(cur);
|
||||||
perror("signal");
|
perror("signal");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue