psppire-window: Fix use-after-free error in read_spv_file().
[pspp] / src / ui / gui / psppire-window.c
index 15f8503de26589aba8b82de8bcccdce830b8a01e..99da30fa3eac4772b15983a705c603a474dbb697 100644 (file)
@@ -796,7 +796,7 @@ read_spv_file (const char *filename)
       if (items[i]->type == SPV_ITEM_TEXT)
         spv_text_submit (items[i]);
       else if (items[i]->type == SPV_ITEM_TABLE)
-        pivot_table_submit (spv_item_get_table (items[i]));
+        pivot_table_submit (pivot_table_ref (spv_item_get_table (items[i])));
       prev_heading = heading;
     }
   dump_heading_transition (prev_heading, spv_get_root (spv));