From b087d1b19e5e57f8b66036674b6b226475e093d6 Mon Sep 17 00:00:00 2001 From: Victor Toso Date: Tue, 15 Feb 2022 20:56:57 +0100 Subject: install-script: Fix leak of GList * Found by covscan. 14. libosinfo-1.9.0/osinfo/osinfo_install_script.c:832: leaked_storage: Variable "values" going out of scope leaks the storage it points to. # 830| propagate_libxml_error(error, _("Unable to create XML node '%s'"), # 831| (const gchar *)tmp1->data); # 832|-> goto error; # 833| } # 834| if (!(xmlAddChild(node, data))) { Signed-off-by: Victor Toso --- osinfo/osinfo_install_script.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osinfo/osinfo_install_script.c b/osinfo/osinfo_install_script.c index 1c9e663..5800f37 100644 --- a/osinfo/osinfo_install_script.c +++ b/osinfo/osinfo_install_script.c @@ -813,7 +813,7 @@ static xmlNodePtr osinfo_install_script_generate_entity_xml(OsinfoInstallScript tmp1 = keys = osinfo_entity_get_param_keys(entity); while (tmp1) { - GList *values; + g_autoptr(GList) values = NULL; GList *tmp2; if (OSINFO_IS_INSTALL_CONFIG(entity)) @@ -839,7 +839,6 @@ static xmlNodePtr osinfo_install_script_generate_entity_xml(OsinfoInstallScript tmp2 = tmp2->next; } - g_list_free(values); tmp1 = tmp1->next; } -- cgit v1.2.1