actually close the fds
This commit is contained in:
parent
dc2969a5f8
commit
44a0d2a9d3
|
@ -107,6 +107,8 @@ char *execstdout(char *file, char *arg[], char *env[]) {
|
|||
continue;
|
||||
} else {
|
||||
free(buf);
|
||||
close(pfds[0]);
|
||||
close(pfds[1]);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -125,10 +127,10 @@ char *execstdout(char *file, char *arg[], char *env[]) {
|
|||
buf[total] = '\0';
|
||||
buf = realloc(buf, strlen(buf));
|
||||
|
||||
return buf;
|
||||
}
|
||||
close(pfds[0]);
|
||||
close(pfds[1]);
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue