[libvirt] [PATCH] tests: avoid compiler warning

Eric Blake eblake at redhat.com
Mon May 2 23:37:06 UTC 2011


../../tests/xmconfigtest.c: In function 'testCompareParseXML':
../../tests/xmconfigtest.c:49:19: error: 'conn' may be used uninitialized in this function [-Wuninitialized]

* tests/xmconfigtest.c (testCompareParseXML): Initialize variable.
---

Pushing under the build-breaker rule.

 tests/xmconfigtest.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c
index 02a8900..6022621 100644
--- a/tests/xmconfigtest.c
+++ b/tests/xmconfigtest.c
@@ -46,7 +46,7 @@ testCompareParseXML(const char *xmcfg, const char *xml, int xendConfigVersion)
     char *gotxmcfgData = NULL;
     virConfPtr conf = NULL;
     int ret = -1;
-    virConnectPtr conn;
+    virConnectPtr conn = NULL;
     int wrote = 4096;
     struct _xenUnifiedPrivate priv;
     virDomainDefPtr def = NULL;
-- 
1.7.4.4




More information about the libvir-list mailing list