]> git.ipfire.org Git - thirdparty/git.git/commitdiff
daemon: plug memory leak
authorRené Scharfe <l.s.r@web.de>
Sat, 24 Oct 2015 12:23:20 +0000 (14:23 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Nov 2015 23:01:23 +0000 (15:01 -0800)
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>
daemon.c

index 4be10914e63bda68272c25e52cb199346cf9ec3c..385934d46e8bc8c76f0eb86824f0f879bf0a0d77 100644 (file)
--- 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;