summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b0fe0d7)
raw | patch | inline | side by side (parent: b0fe0d7)
author | Mike Hommey <mh@glandium.org> | |
Tue, 11 Dec 2007 21:59:55 +0000 (22:59 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 12 Dec 2007 18:59:22 +0000 (10:59 -0800) |
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>
avoid NULL dereference. Better safe than sorry.
Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-blame.c | patch | blob | history | |
builtin-reset.c | patch | blob | history | |
tree-diff.c | patch | blob | history |
diff --git a/builtin-blame.c b/builtin-blame.c
index eda79d0f00f5696f6436b67390bf84f8b2f7cb9c..5466d01f9a5917dbba4108669ee4513b581ff2c9 100644 (file)
--- a/builtin-blame.c
+++ b/builtin-blame.c
}
}
diff_flush(&diff_opts);
+ diff_tree_release_paths(&diff_opts);
if (porigin) {
/*
* Create a freestanding copy that is not part of
}
}
diff_flush(&diff_opts);
+ diff_tree_release_paths(&diff_opts);
return porigin;
}
}
}
diff_flush(&diff_opts);
-
+ diff_tree_release_paths(&diff_opts);
return retval;
}
diff --git a/builtin-reset.c b/builtin-reset.c
index 4c61025aaef96ae9f8bcabe3fd4ad6c0fc2beba3..713c2d5346e8dc7e502beffc256bfdcad9da6ad5 100644 (file)
--- a/builtin-reset.c
+++ b/builtin-reset.c
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() */
diff --git a/tree-diff.c b/tree-diff.c
index aa0a100295c5c48483c6bfbbfc0105b70680becc..e1e2e6c6ce3c4effffb26e9aed7c6bdd2b00a5ae 100644 (file)
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -326,6 +326,7 @@ static void try_to_follow_renames(struct tree_desc *t1, struct tree_desc *t2, co
die("unable to set up diff options to follow renames");
diff_tree(t1, t2, base, &diff_opts);
diffcore_std(&diff_opts);
+ diff_tree_release_paths(&diff_opts);
/* Go through the new set of filepairing, and see if we find a more interesting one */
for (i = 0; i < q->nr; i++) {
@@ -342,6 +343,7 @@ static void try_to_follow_renames(struct tree_desc *t1, struct tree_desc *t2, co
choice = p;
/* Update the path we use from now on.. */
+ diff_tree_release_paths(opt);
opt->paths[0] = xstrdup(p->one->path);
diff_tree_setup_paths(opt->paths, opt);
break;