aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2012-07-12 01:00:31 +0200
committerThomas White <taw@bitwiz.org.uk>2012-07-12 01:00:31 +0200
commitcb2623e64fed28efdc0d3b3de2338ab57684985b (patch)
tree732fa612849c63f9428529c3cf4554cf2605e70c
parentce55f225c659adf6a96648e0faa223a7ea602858 (diff)
Fix leaked fds
-rw-r--r--src/indexamajig.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c
index 7310d391..5a8bd816 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -1257,6 +1257,10 @@ int main(int argc, char *argv[])
free(result_fhs);
fclose(fh);
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
* pipe, and the 'write' end of the result pipe. */