Fix double heap deallocation when erroneous SET was specified.
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 26 Mar 2016 15:34:20 +0000 (16:34 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 26 Mar 2016 15:34:20 +0000 (16:34 +0100)
Found by zzuf.

src/language/utilities/set.q
tests/language/utilities/set.at

index 126868dbdb52f107844200b75a9e41f8c8ff9507..f640bcbd65b6a5e6949eb1a1e95c26400c763a08 100644 (file)
@@ -137,7 +137,6 @@ cmd_set (struct lexer *lexer, struct dataset *ds)
 
   if (!parse_set (lexer, ds, &cmd, NULL))
     {
-      free_set (&cmd);
       return CMD_FAILURE;
     }
 
index b281ae4e1d6c88c191231e6efc39ee5529a5e471..ef31c836c887b397b58448ab7b01c1a7c69a05c6 100644 (file)
@@ -22,6 +22,16 @@ x,3,2.00,1.00,1.00,3.00
 AT_CLEANUP
 
 
+dnl This scenario was observed to erroneously free things twice
+AT_SETUP([SET crash on invalid cc])
+AT_DATA([set.pspp], [dnl
+SET CCA='xxxx'.SHGW CCA.
+])
+
+AT_CHECK([pspp -O format=csv set.pspp], [1], [ignore])
+AT_CLEANUP
+
+
 
 AT_SETUP([SET MXWARNS])
 dnl Make sure that syntax processing stops and that
@@ -92,7 +102,9 @@ x,y,z
 ])
 
 AT_CLEANUP
+
 \f
+
 AT_BANNER([PRESERVE and RESTORE])
 
 AT_SETUP([PRESERVE of SET FORMAT])