Skip to content
Snippets Groups Projects
Commit b1b49ff8 authored by René Scharfe's avatar René Scharfe Committed by Junio C Hamano
Browse files

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: default avatarRene Scharfe <l.s.r@web.de>
Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
parent 2d71608e
No related branches found
No related tags found
No related merge requests found
...@@ -802,6 +802,7 @@ static void check_dead_children(void) ...@@ -802,6 +802,7 @@ static void check_dead_children(void)
/* remove the child */ /* remove the child */
*cradle = blanket->next; *cradle = blanket->next;
live_children--; live_children--;
child_process_clear(&blanket->cld);
free(blanket); free(blanket);
} else } else
cradle = &blanket->next; cradle = &blanket->next;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment