From: Sverre Rabbelier Date: Wed, 18 Nov 2009 01:42:29 +0000 (+0100) Subject: Fix various memory leaks in transport-helper.c X-Git-Tag: v1.7.0-rc0~101^2~14 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=b962dbdc806510a4572a5574245d825a414231ab;p=git.git Fix various memory leaks in transport-helper.c Found with: valgrind --tool=memcheck --leak-check=full --show-reachable=yes Signed-off-by: Sverre Rabbelier Signed-off-by: Junio C Hamano --- diff --git a/transport-helper.c b/transport-helper.c index da8185a98..628a5ca21 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -74,6 +74,7 @@ static struct child_process *get_helper(struct transport *transport) } free(refspecs); } + strbuf_release(&buf); return data->helper; } @@ -163,6 +164,8 @@ static int fetch_with_import(struct transport *transport, } disconnect_helper(transport); finish_command(&fastimport); + free(fastimport.argv); + fastimport.argv = NULL; for (i = 0; i < nr_heads; i++) { char *private; @@ -176,6 +179,7 @@ static int fetch_with_import(struct transport *transport, read_ref(private, posn->old_sha1); free(private); } + strbuf_release(&buf); return 0; }