[virt-tools-list] [libosinfo 2/2] Add missing NULL initialization

Christophe Fergeau cfergeau at redhat.com
Fri Dec 14 15:43:00 UTC 2012


In error cases, this 'ret' variable can be gfree'd before having
been set, so it must be initialized to NULL at the beginning
of the function. Issue spotted by Coverity.
---
 osinfo/osinfo_install_script.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/osinfo/osinfo_install_script.c b/osinfo/osinfo_install_script.c
index 2aa1aa0..d72c394 100644
--- a/osinfo/osinfo_install_script.c
+++ b/osinfo/osinfo_install_script.c
@@ -731,7 +731,7 @@ static gchar *osinfo_install_script_apply_xslt(xsltStylesheetPtr ss,
                                                GError **error)
 {
     xsltTransformContextPtr ctxt;
-    gchar *ret;
+    gchar *ret = NULL;
     xmlDocPtr docOut = NULL;
     int len;
 
-- 
1.8.0.2




More information about the virt-tools-list mailing list