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>
This commit is contained in:
committed by
Junio C Hamano
parent
b0fe0d7258
commit
03b69c7606
@ -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() */
|
||||
|
||||
Reference in New Issue
Block a user