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-blame.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'builtin-blame.c') diff --git a/builtin-blame.c b/builtin-blame.c index eda79d0f00..5466d01f9a 100644 --- a/builtin-blame.c +++ b/builtin-blame.c @@ -388,6 +388,7 @@ static struct origin *find_origin(struct scoreboard *sb, } } diff_flush(&diff_opts); + diff_tree_release_paths(&diff_opts); if (porigin) { /* * Create a freestanding copy that is not part of @@ -444,6 +445,7 @@ static struct origin *find_rename(struct scoreboard *sb, } } diff_flush(&diff_opts); + diff_tree_release_paths(&diff_opts); return porigin; } @@ -1165,7 +1167,7 @@ static int find_copy_in_parent(struct scoreboard *sb, } } diff_flush(&diff_opts); - + diff_tree_release_paths(&diff_opts); return retval; } -- cgit v1.2.1