]> xenbits.xensource.com Git - libvirt.git/commitdiff
test.c: don't use undefined local, "def"
authorJim Meyering <meyering@redhat.com>
Thu, 3 Sep 2009 10:12:19 +0000 (12:12 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 3 Sep 2009 16:04:23 +0000 (18:04 +0200)
* src/test.c (testOpenVolumesForPool): Upon early virAsprintf or
virXPathNodeSet failure, "goto error" would take us to
virStorageVolDefFree(def), but with "def" not defined.
Initialize it to NULL.

src/test.c

index 7c8f85b0eaf193cf0da4293389c329d51aa94590..895cce1084460f13301332c65c1f0df65b47e6af 100644 (file)
@@ -435,7 +435,7 @@ static int testOpenVolumesForPool(virConnectPtr conn,
     char *vol_xpath;
     int i, ret, func_ret = -1;
     xmlNodePtr *vols = NULL;
-    virStorageVolDefPtr def;
+    virStorageVolDefPtr def = NULL;
 
     /* Find storage volumes */
     if (virAsprintf(&vol_xpath, "/node/pool[%d]/volume", poolidx) < 0) {