mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
parallels: check and handle error for virAsprintf() calls
Ignore the return in parallelsMakePoolName() since subsequent check validates name was allocated.
This commit is contained in:
parent
62cc7b702b
commit
718af45895
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user