pivot-table-test: Fix memory leak when table is not displayed.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 9 Oct 2021 17:13:34 +0000 (10:13 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 9 Oct 2021 17:13:34 +0000 (10:13 -0700)
Found by Address Sanitizer.

tests/output/pivot-table-test.c

index f1944c3237bf828a5f29f44ee0f3e7f954085c74..9e91bfe3bf4e3c8e19f0f8b4b3e373005e51fd06 100644 (file)
@@ -1224,7 +1224,7 @@ read_table (struct lexer *lexer)
   if (!displayed)
     pivot_table_submit (pt);
   else
-    pivot_table_unshare (pt);
+    pivot_table_unref (pt);
 
   force_match (lexer, T_ENDCMD);
 }