summaryrefslogtreecommitdiff
path: root/builtin-blame.c
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2007-12-11 21:59:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-12-12 18:59:22 (GMT)
commit03b69c7606267bc978c69cf88fcd7a8edf8175bc (patch)
tree7305a71d161adf2d7db014cacea71916dc8b874d /builtin-blame.c
parentb0fe0d7258951779b790190b10ca21ffc5573546 (diff)
downloadgit-03b69c7606267bc978c69cf88fcd7a8edf8175bc.zip
git-03b69c7606267bc978c69cf88fcd7a8edf8175bc.tar.gz
git-03b69c7606267bc978c69cf88fcd7a8edf8175bc.tar.bz2
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-blame.c')
-rw-r--r--builtin-blame.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin-blame.c b/builtin-blame.c
index eda79d0..5466d01 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;
}