Skip to content

Commit 483709a

Browse files
committed
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
2 parents 5800c63 + 9e7d8a9 commit 483709a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

blame.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,7 +1663,7 @@ static struct commit *find_single_final(struct rev_info *revs,
16631663
name = revs->pending.objects[i].name;
16641664
}
16651665
if (name_p)
1666-
*name_p = name;
1666+
*name_p = xstrdup_or_null(name);
16671667
return found;
16681668
}
16691669

@@ -1735,7 +1735,7 @@ static struct commit *find_single_initial(struct rev_info *revs,
17351735
die("No commit to dig up from?");
17361736

17371737
if (name_p)
1738-
*name_p = name;
1738+
*name_p = xstrdup(name);
17391739
return found;
17401740
}
17411741

@@ -1843,6 +1843,8 @@ void setup_scoreboard(struct blame_scoreboard *sb, const char *path, struct blam
18431843

18441844
if (orig)
18451845
*orig = o;
1846+
1847+
free((char *)final_commit_name);
18461848
}
18471849

18481850

0 commit comments

Comments
 (0)