[Libvir] [PATCH] Avoid "may be used uninitialized" warning.

Jim Meyering jim at meyering.net
Mon Jan 21 16:47:39 UTC 2008

I've been seeing this on rawhide for a few days:

xmconfigtest.c:115: warning: 'old_priv' may be used uninitialized in this function

Here's a fix:

	Avoid "may be used uninitialized" warning.
	* tests/xmconfigtest.c (testCompareParseXML): Initialize "old_priv".

Signed-off-by: Jim Meyering <meyering at redhat.com>
 tests/xmconfigtest.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c
index d66b660..f49ca6c 100644
--- a/tests/xmconfigtest.c
+++ b/tests/xmconfigtest.c
@@ -51,7 +51,7 @@ static int testCompareParseXML(const char *xmcfg_rel, const char *xml_rel,
     int ret = -1;
     virConnectPtr conn;
     int wrote = MAX_FILE;
-    void *old_priv;
+    void *old_priv = NULL;
     struct _xenUnifiedPrivate priv;
     char xmcfg[PATH_MAX];
     char xml[PATH_MAX];

More information about the libvir-list mailing list