summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorLibravatar Ævar Arnfjörð Bjarmason <avarab@gmail.com>2022-03-04 19:32:06 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-03-04 13:24:18 -0800
commita18d66cefb9e5ee4fd49be1d60e90523cd89ca0f (patch)
tree2ea7744899680fba7ce823d8378820ed191a0d2b /diff.c
parentmerge-base: free() allocated "struct commit **" list (diff)
downloadtgif-a18d66cefb9e5ee4fd49be1d60e90523cd89ca0f.tar.xz
diff.c: free "buf" in diff_words_flush()
Amend the freeing logic added in e6e045f8031 (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>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index c4ccb6b1a3..c5bc9bc512 100644
--- a/diff.c
+++ b/diff.c
@@ -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;
}