diff.c: free "buf" in diff_words_flush()

Amend the freeing logic added in e6e045f803 (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>
This commit is contained in:
Ævar Arnfjörð Bjarmason 2022-03-04 19:32:06 +01:00 committed by Junio C Hamano
parent e69fe2e460
commit a18d66cefb

1
diff.c
View File

@ -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;
}