Skip to content

Commit b76c056

Browse files
peffgitster
authored andcommitted
fix textconv leak in emit_rewrite_diff
We correctly free() for the normal diff case, but leak for rewrite diffs. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c00e657 commit b76c056

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

diff.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,10 @@ static void emit_rewrite_diff(const char *name_a,
550550
emit_rewrite_lines(&ecbdata, '-', data_one, size_one);
551551
if (lc_b)
552552
emit_rewrite_lines(&ecbdata, '+', data_two, size_two);
553+
if (textconv_one)
554+
free(data_one);
555+
if (textconv_two)
556+
free(data_two);
553557
}
554558

555559
struct diff_words_buffer {

0 commit comments

Comments
 (0)