From 9d65076eba305cbf07798348d1f4e51a41c27636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 10 May 2024 18:06:20 +0200 Subject: [PATCH] girepository/girparser: Cleanup the node stack if anything destroyed it If we've leftover nodes in the stack we should cleanup it --- girepository/girparser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/girepository/girparser.c b/girepository/girparser.c index 046ba2f98..2ff9009a0 100644 --- a/girepository/girparser.c +++ b/girepository/girparser.c @@ -3740,6 +3740,8 @@ cleanup (GMarkupParseContext *context, ParseContext *ctx = user_data; GList *m; + g_clear_slist (&ctx->node_stack, NULL); + for (m = ctx->modules; m; m = m->next) gi_ir_module_free (m->data); g_list_free (ctx->modules); @@ -3821,6 +3823,7 @@ gi_ir_parser_parse_string (GIIrParser *parser, g_list_free (ctx.include_modules); } + g_clear_slist (&ctx.node_stack, NULL); g_markup_parse_context_free (context); if (ctx.modules)