From e429f109ca7ac63fb68922e9b7a964a14fedba0f Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 12 Jan 2019 16:51:56 -0800 Subject: [PATCH] pivot-table: Fix use-after-free error. --- src/output/pivot-table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/output/pivot-table.c b/src/output/pivot-table.c index 41337cde73..2adcf62634 100644 --- a/src/output/pivot-table.c +++ b/src/output/pivot-table.c @@ -1791,8 +1791,8 @@ pivot_value_destroy (struct pivot_value *value) font_style_uninit (value->font_style); free (value->font_style); free (value->cell_style); - for (size_t i = 0; i < value->n_footnotes; i++) - pivot_footnote_destroy (value->footnotes[i]); + /* Do not free the elements of footnotes because VALUE does not own + them. */ free (value->footnotes); switch (value->type) -- 2.30.2