summaryrefslogtreecommitdiff
path: root/blame.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-07-31 13:05:15 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-07-31 13:05:15 -0700
commit483709ab4dced5710c600a98b1222ca174d53daa (patch)
tree508f271b5219a20eb4a1930777f7f5e330a73092 /blame.c
parentGit 2.14-rc1 (diff)
parentblame: fix memory corruption scrambling revision name in error message (diff)
downloadtgif-483709ab4dced5710c600a98b1222ca174d53daa.tar.xz
Merge branch 'js/blame-lib'
A hotfix to a topic already in 'master'. * js/blame-lib: blame: fix memory corruption scrambling revision name in error message
Diffstat (limited to 'blame.c')
-rw-r--r--blame.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/blame.c b/blame.c
index 91e26e93e8..f575e9cbf4 100644
--- a/blame.c
+++ b/blame.c
@@ -1663,7 +1663,7 @@ static struct commit *find_single_final(struct rev_info *revs,
name = revs->pending.objects[i].name;
}
if (name_p)
- *name_p = name;
+ *name_p = xstrdup_or_null(name);
return found;
}
@@ -1735,7 +1735,7 @@ static struct commit *find_single_initial(struct rev_info *revs,
die("No commit to dig up from?");
if (name_p)
- *name_p = name;
+ *name_p = xstrdup(name);
return found;
}
@@ -1843,6 +1843,8 @@ void setup_scoreboard(struct blame_scoreboard *sb, const char *path, struct blam
if (orig)
*orig = o;
+
+ free((char *)final_commit_name);
}