X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fpivot-output.c;h=44d5f885b851c9affe1460cec668d9260fa0ad2e;hb=1aef11b9589a534333bbecd528efe1022a4bb9bb;hp=d6925ceb83030a4f30f6ff3f8206f2d1cbc13daa;hpb=9ceda5b4082cf665b5279cc5c56ecbe4fd44fb15;p=pspp diff --git a/src/output/pivot-output.c b/src/output/pivot-output.c index d6925ceb83..44d5f885b8 100644 --- a/src/output/pivot-output.c +++ b/src/output/pivot-output.c @@ -349,15 +349,19 @@ pivot_table_submit_layer (const struct pivot_table *st, struct footnote **footnotes = xcalloc (st->n_footnotes, sizeof *footnotes); for (size_t i = 0; i < st->n_footnotes; i++) - footnotes[i] = tab_create_footnote ( - table, i, - pivot_value_to_string (st->footnotes[i]->content, - st->show_values, st->show_variables), - pivot_value_to_string (st->footnotes[i]->marker, - st->show_values, st->show_variables), - area_style_override (table->container, &st->areas[PIVOT_AREA_FOOTER], - st->footnotes[i]->content->cell_style, - st->footnotes[i]->content->font_style)); + { + char *content = pivot_value_to_string ( + st->footnotes[i]->content, st->show_values, st->show_variables); + char *marker = pivot_value_to_string ( + st->footnotes[i]->marker, st->show_values, st->show_variables); + footnotes[i] = tab_create_footnote ( + table, i, content, marker, + area_style_override (table->container, &st->areas[PIVOT_AREA_FOOTER], + st->footnotes[i]->content->cell_style, + st->footnotes[i]->content->font_style)); + free (marker); + free (content); + } compose_headings (table, &st->axes[PIVOT_AXIS_COLUMN], H, &st->axes[PIVOT_AXIS_ROW], @@ -479,11 +483,12 @@ pivot_table_submit_layer (const struct pivot_table *st, table_item_text_destroy (caption); } + free (footnotes); table_item_submit (ti); } void -pivot_table_submit (const struct pivot_table *st) +pivot_table_submit (struct pivot_table *st) { pivot_table_assign_label_depth (CONST_CAST (struct pivot_table *, st)); @@ -506,4 +511,6 @@ pivot_table_submit (const struct pivot_table *st) pivot_table_submit_layer (st, st->current_layer); settings_set_decimal_char (old_decimal); + + pivot_table_destroy (st); }