Skip to content

Commit

Permalink
Merge branch 'js/blame-lib'
Browse files Browse the repository at this point in the history
A hotfix to a topic already in 'master'.

* js/blame-lib:
  blame: fix memory corruption scrambling revision name in error message
  • Loading branch information
gitster committed Jul 31, 2017
2 parents 5800c63 + 9e7d8a9 commit 483709a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
}


Expand Down

0 comments on commit 483709a

Please sign in to comment.