Skip to content

Commit b1b49ff

Browse files
rscharfegitster
authored andcommitted
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 f063d38 (daemon: use cld->env_array when re-spawning). Signed-off-by: Rene Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2d71608 commit b1b49ff

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

daemon.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,7 @@ static void check_dead_children(void)
802802
/* remove the child */
803803
*cradle = blanket->next;
804804
live_children--;
805+
child_process_clear(&blanket->cld);
805806
free(blanket);
806807
} else
807808
cradle = &blanket->next;

0 commit comments

Comments
 (0)