pivot-table: Fix use-after-free error.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 13 Jan 2019 00:51:56 +0000 (16:51 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 13 Jan 2019 00:59:37 +0000 (16:59 -0800)
src/output/pivot-table.c

index 41337cde73eccecfef006de01a2a92f3bedf53b0..2adcf62634d32a3385a513cd85e344b9870a0d77 100644 (file)
@@ -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)