From: John Ferlan Date: Thu, 3 Jan 2013 19:16:14 +0000 (-0500) Subject: parallels: check and handle error for virAsprintf() calls X-Git-Tag: v1.0.2-rc1~304 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=718af45895cc3d95401df71908f707472d3f7398;p=thirdparty%2Flibvirt.git parallels: check and handle error for virAsprintf() calls Ignore the return in parallelsMakePoolName() since subsequent check validates name was allocated. --- diff --git a/src/parallels/parallels_storage.c b/src/parallels/parallels_storage.c index e768d881f8..2908bee4f3 100644 --- a/src/parallels/parallels_storage.c +++ b/src/parallels/parallels_storage.c @@ -146,7 +146,7 @@ static char *parallelsMakePoolName(virConnectPtr conn, const char *path) if (i == 0) name = strdup(path); else - virAsprintf(&name, "%s-%u", path, i); + ignore_value(virAsprintf(&name, "%s-%u", path, i)); if (!name) { virReportOOMError(); @@ -310,8 +310,7 @@ static int parallelsAddDiskVolume(virStoragePoolObjPtr pool, if (VIR_ALLOC(def)) goto no_memory; - virAsprintf(&def->name, "%s-%s", dom->def->name, diskName); - if (!def->name) + if (virAsprintf(&def->name, "%s-%s", dom->def->name, diskName) < 0) goto no_memory; def->type = VIR_STORAGE_VOL_FILE;