summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2015-10-24 12:23:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-11-02 23:01:23 (GMT)
commitb1b49ff8d42a21ade6a72b40a147fd3eaff3db8d (patch)
tree89bcdf62b5ce148889b0517ff58c1996051624d6
parent2d71608ec0b6d098ed7c8c914fb7004b28349995 (diff)
downloadgit-b1b49ff8d42a21ade6a72b40a147fd3eaff3db8d.zip
git-b1b49ff8d42a21ade6a72b40a147fd3eaff3db8d.tar.gz
git-b1b49ff8d42a21ade6a72b40a147fd3eaff3db8d.tar.bz2
daemon: plug memory leak
Call child_process_clear() when a child ends to release the memory allocated for its environment. This is necessary because unlike all other users of start_command() we don't call finish_command(), which would have taken care of that for us. This leak was introduced by f063d38b (daemon: use cld->env_array when re-spawning). Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--daemon.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/daemon.c b/daemon.c
index 4be1091..385934d 100644
--- a/daemon.c
+++ b/daemon.c
@@ -802,6 +802,7 @@ static void check_dead_children(void)
/* remove the child */
*cradle = blanket->next;
live_children--;
+ child_process_clear(&blanket->cld);
free(blanket);
} else
cradle = &blanket->next;