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

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



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


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