Skip to content

Commit

Permalink
fix textconv leak in emit_rewrite_diff
Browse files Browse the repository at this point in the history
We correctly free() for the normal diff case, but leak for
rewrite diffs.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Apr 2, 2010
1 parent c00e657 commit b76c056
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,10 @@ static void emit_rewrite_diff(const char *name_a,
emit_rewrite_lines(&ecbdata, '-', data_one, size_one);
if (lc_b)
emit_rewrite_lines(&ecbdata, '+', data_two, size_two);
if (textconv_one)
free(data_one);
if (textconv_two)
free(data_two);
}

struct diff_words_buffer {
Expand Down

0 comments on commit b76c056

Please sign in to comment.