Commit cb2623e6 authored by Thomas White's avatar Thomas White
Browse files

Fix leaked fds

parent ce55f225
...@@ -1257,6 +1257,10 @@ int main(int argc, char *argv[]) ...@@ -1257,6 +1257,10 @@ int main(int argc, char *argv[])
free(result_fhs); free(result_fhs);
fclose(fh); fclose(fh);
free(pids); free(pids);
for ( j=0; j<i-1; j++ ) {
fclose(result_fhs[j]);
close(filename_pipes[j]);
}
/* Child process gets the 'read' end of the filename /* Child process gets the 'read' end of the filename
* pipe, and the 'write' end of the result pipe. */ * pipe, and the 'write' end of the result pipe. */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment