]> git.ipfire.org Git - pakfire.git/commitdiff
parser: Check if subparsers are set before freeing them
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 4 May 2021 09:33:38 +0000 (09:33 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 4 May 2021 09:33:38 +0000 (09:33 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/parser/grammar.y

index d17d3e918ca8b9a72003b894f1b384aa5e048421..85c347a154b7b77af8265089d22c6566401c1abf 100644 (file)
@@ -344,6 +344,11 @@ subparser_name                             : T_SUBPARSER
 if_stmt                                                : T_IF T_STRING T_EQUALS T_STRING T_EOL subgrammar else_stmt T_END T_EOL
                                                        {
                                                                $$ = make_if_stmt(pakfire, parent, OP_EQUALS, $2, $4, $6, $7);
+
+                                                               if ($6)
+                                                                       pakfire_parser_unref($6);
+                                                               if ($7)
+                                                                       pakfire_parser_unref($7);
                                                        }
                                                        ;