Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2007-12-12 00:59:55 +0300
committerJunio C Hamano <gitster@pobox.com>2007-12-12 21:59:22 +0300
commit03b69c7606267bc978c69cf88fcd7a8edf8175bc (patch)
tree7305a71d161adf2d7db014cacea71916dc8b874d /builtin-reset.c
parentb0fe0d7258951779b790190b10ca21ffc5573546 (diff)
Fix small memory leaks induced by diff_tree_setup_paths
Run diff_tree_release_paths in the appropriate places, and add a test to avoid NULL dereference. Better safe than sorry. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-reset.c')
-rw-r--r--builtin-reset.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin-reset.c b/builtin-reset.c
index 4c61025aae..713c2d5346 100644
--- a/builtin-reset.c
+++ b/builtin-reset.c
@@ -158,6 +158,7 @@ static int read_from_tree(const char *prefix, const char **argv,
return 1;
diffcore_std(&opt);
diff_flush(&opt);
+ diff_tree_release_paths(&opt);
if (!index_was_discarded)
/* The index is still clobbered from do_diff_cache() */