Fix various memory leaks in transport-helper.c
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>
Sverre Rabbelier committed
Nov 18, 2009 at 02:42 UTC
b962dbdc806510a4572a5574245d825a414231ab
1 file changed
+4
transport-helper.c
+4
@@ -74,6 +74,7 @@ static struct child_process *get_helper(struct transport *transport)
74
}
75
free(refspecs);
76
}
77
+ strbuf_release(&buf);
78
return data->helper;
79
}
80
@@ -163,6 +164,8 @@ static int fetch_with_import(struct transport *transport,
164
}
165
disconnect_helper(transport);
166
finish_command(&fastimport);
167
+ free(fastimport.argv);
168
+ fastimport.argv = NULL;
169
170
for (i = 0; i < nr_heads; i++) {
171
char *private;
@@ -176,6 +179,7 @@ static int fetch_with_import(struct transport *transport,
179
read_ref(private, posn->old_sha1);
180
free(private);
181
}
182
+ strbuf_release(&buf);
183
return 0;
184
}
185