test.c: don't use undefined local, "def"

* 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.
This commit is contained in:
Jim Meyering 2009-09-03 12:12:19 +02:00
parent f435a3002b
commit 20f1f714ba

View 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) {