Skip to content

Commit

Permalink
diffcore-rename: plug memory leak.
Browse files Browse the repository at this point in the history
Spotted by Nicolas Pitre.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Feb 23, 2006
1 parent 6dc78e6 commit 09a5d72
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion diffcore-rename.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,10 @@ static int estimate_similarity(struct diff_filespec *src,
/* A delta that has a lot of literal additions would have
* big delta_size no matter what else it does.
*/
if (base_size * (MAX_SCORE-minimum_score) < delta_size * MAX_SCORE)
if (base_size * (MAX_SCORE-minimum_score) < delta_size * MAX_SCORE) {
free(delta);
return 0;
}

/* Estimate the edit size by interpreting delta. */
if (count_delta(delta, delta_size, &src_copied, &literal_added)) {
Expand Down

0 comments on commit 09a5d72

Please sign in to comment.