Skip to content

Commit

Permalink
diff.c: free "buf" in diff_words_flush()
Browse files Browse the repository at this point in the history
Amend the freeing logic added in e6e045f (diff.c: buffer all
output if asked to, 2017-06-29) to free the containing "buf" in
addition to its members.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
avar authored and gitster committed Mar 4, 2022
1 parent e69fe2e commit a18d66c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -2150,6 +2150,7 @@ static void diff_words_flush(struct emit_callback *ecbdata)

for (i = 0; i < wol->nr; i++)
free((void *)wol->buf[i].line);
free(wol->buf);

wol->nr = 0;
}
Expand Down

0 comments on commit a18d66c

Please sign in to comment.