[PATCH 09/14] install-script: Fix leak in error case in generate_entity_xml()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The key list returned by osinfo_entity_get_param_keys() was freed in the
nominal case, but not in the error case.
---
 osinfo/osinfo_install_script.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/osinfo/osinfo_install_script.c b/osinfo/osinfo_install_script.c
index a290d2a..23831c5 100644
--- a/osinfo/osinfo_install_script.c
+++ b/osinfo/osinfo_install_script.c
@@ -662,7 +662,7 @@ static xmlNodePtr osinfo_install_script_generate_entity_xml(OsinfoInstallScript
 {
     xmlNodePtr node = NULL;
     xmlNodePtr data = NULL;
-    GList *keys;
+    GList *keys = NULL;
     GList *tmp1;
 
     if (!(node = xmlNewDocNode(NULL, NULL, (xmlChar*)name, NULL))) {
@@ -725,6 +725,7 @@ static xmlNodePtr osinfo_install_script_generate_entity_xml(OsinfoInstallScript
     return node;
 
  error:
+    g_list_free(keys);
     xmlFreeNode(data);
     xmlFreeNode(node);
     return NULL;
-- 
2.7.4

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux