Fix use after free error in vector command.
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 20 Jun 2020 05:17:06 +0000 (07:17 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 20 Jun 2020 05:17:03 +0000 (07:17 +0200)
Reported by: Andrea Fioraldi.

Fixes bug: #58592

src/language/dictionary/vector.c

index 6560288c472e1232aed890d6d3e8dde7c4540998..28e97b15d8aa9643475dfdbbcd1d964d164ebc3c 100644 (file)
@@ -167,8 +167,8 @@ cmd_vector (struct lexer *lexer, struct dataset *ds)
                     }
                   if (dict_lookup_var (dict, name))
                    {
-                      free (name);
                      msg (SE, _("%s is an existing variable name."), name);
+                      free (name);
                      goto fail;
                    }
                   free (name);