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:
parent
4f588a1b46
commit
2a6395aa1d
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user