From 4c9899f4be8c8461215424fd1249f78c9f1267e0 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 14 Apr 2024 09:51:58 -0700 Subject: [PATCH] SHOW: Fix memory leak on error path. --- src/language/commands/set.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/language/commands/set.c b/src/language/commands/set.c index bca5521f4..a2d8fa6ad 100644 --- a/src/language/commands/set.c +++ b/src/language/commands/set.c @@ -1491,14 +1491,14 @@ cmd_show (struct lexer *lexer, struct dataset *ds) } } lex_error (lexer, _("Syntax error expecting the name of a setting.")); - return CMD_FAILURE; + goto error; found: ; } else { lex_error (lexer, _("Syntax error expecting the name of a setting.")); - return CMD_FAILURE; + goto error; } lex_match (lexer, T_SLASH); @@ -1509,6 +1509,10 @@ cmd_show (struct lexer *lexer, struct dataset *ds) pivot_table_submit (pt); return CMD_SUCCESS; + +error: + pivot_table_unref (pt); + return CMD_FAILURE; } #define MAX_SAVED_SETTINGS 5 -- 2.11.4.GIT