mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
storage: fix crash when listing volumes or undefining a pool
The commit cad3cf9a95 introduced a crash
due to wrong order of parameters being passed to the function. When
deleting an element, the function decreased the iterator instead of
count and if listing volumes after that (or undefining the pool, NULL
was being dereferenced.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
@@ -1566,7 +1566,7 @@ storageVolDelete(virStorageVolPtr obj,
|
||||
vol->name, pool->def->name);
|
||||
virStorageVolDefFree(vol);
|
||||
|
||||
VIR_DELETE_ELEMENT(pool->volumes.objs, pool->volumes.count, i);
|
||||
VIR_DELETE_ELEMENT(pool->volumes.objs, i, pool->volumes.count);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user