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>

René Scharfe committed Oct 24, 2015 at 14:23 UTC b1b49ff8d42a21ade6a72b40a147fd3eaff3db8d
1 file changed +1
daemon.c
+1
@@ -802,6 +802,7 @@ static void check_dead_children(void)
802 /* remove the child */
803 *cradle = blanket->next;
804 live_children--;
805 + child_process_clear(&blanket->cld);
806 free(blanket);
807 } else
808 cradle = &blanket->next;