From 03b69c7606267bc978c69cf88fcd7a8edf8175bc Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 11 Dec 2007 22:59:55 +0100 Subject: 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 Signed-off-by: Junio C Hamano --- builtin-reset.c | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin-reset.c') 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() */ -- cgit v1.2.3