Skip to content

Commit

Permalink
daemon: plug memory leak
Browse files Browse the repository at this point in the history
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 f063d38 (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>
  • Loading branch information
René Scharfe authored and Junio C Hamano committed Nov 2, 2015
1 parent 2d71608 commit b1b49ff
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions daemon.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit b1b49ff

Please sign in to comment.