From: Ben Pfaff Date: Sun, 13 Jan 2019 00:51:56 +0000 (-0800) Subject: pivot-table: Fix use-after-free error. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=e429f109ca7ac63fb68922e9b7a964a14fedba0f pivot-table: Fix use-after-free error. --- 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)