girepository/girparser: Cleanup the node stack if anything destroyed it

If we've leftover nodes in the stack we should cleanup it
This commit is contained in:
Marco Trevisan (Treviño) 2024-05-10 18:06:20 +02:00 committed by Philip Withnall
parent 997d32e9cd
commit 9d65076eba

View File

@ -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)