Skip to content

Commit

Permalink
Fix various memory leaks in transport-helper.c
Browse files Browse the repository at this point in the history
Found with:
valgrind --tool=memcheck --leak-check=full --show-reachable=yes

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Sverre Rabbelier authored and Junio C Hamano committed Nov 18, 2009
1 parent 72ff894 commit b962dbd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions transport-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ static struct child_process *get_helper(struct transport *transport)
}
free(refspecs);
}
strbuf_release(&buf);
return data->helper;
}

Expand Down Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down

0 comments on commit b962dbd

Please sign in to comment.