mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
storage: Fix error path in virStorageBackendSheepdogRefreshVol
If the virAsprintf of the vol->key fails, then we would erroneously return the '0' from the @ret from virStorageBackendSheepdogParseVdiList. So in this error path case, let's set ret = -1. Signed-off-by: John Ferlan <jferlan@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
7550480036
commit
8a69cbc181
@ -359,9 +359,10 @@ virStorageBackendSheepdogRefreshVol(virStoragePoolObjPtr pool,
|
||||
vol->type = VIR_STORAGE_VOL_NETWORK;
|
||||
|
||||
VIR_FREE(vol->key);
|
||||
if (virAsprintf(&vol->key, "%s/%s",
|
||||
def->source.name, vol->name) < 0)
|
||||
if (virAsprintf(&vol->key, "%s/%s", def->source.name, vol->name) < 0) {
|
||||
ret = -1;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
VIR_FREE(vol->target.path);
|
||||
ignore_value(VIR_STRDUP(vol->target.path, vol->name));
|
||||
|
Loading…
Reference in New Issue
Block a user