1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-25 10:03:49 +03:00

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.
This commit is contained in:
Roman Bogorodskiy 2014-06-10 21:08:13 +04:00
parent c85b09cd7a
commit 0568db02a5

View File

@ -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;