From: Roman Bogorodskiy Date: Tue, 10 Jun 2014 17:08:13 +0000 (+0400) Subject: vbox: fix compilation error X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0568db02a50627166451e38071047197da528d6b;p=libvirt.git vbox: fix compilation error clang complains about possibly uninitialized variable: vbox/vbox_snapshot_conf.c:1355:9: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] if (!(xPathContext = xmlXPathNewContext(xml))) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ So init 'ret' with NULL. --- diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c index 49096650af..9c78410302 100644 --- a/src/vbox/vbox_snapshot_conf.c +++ b/src/vbox/vbox_snapshot_conf.c @@ -1336,7 +1336,7 @@ virVBoxSnapshotConfGetRODisksPathsFromLibvirtXML(const char *filePath, { int result = -1; size_t i = 0; - char **ret; + char **ret = NULL; xmlDocPtr xml = NULL; xmlXPathContextPtr xPathContext = NULL; xmlNodePtr *nodes = NULL;