mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 05:17:59 +03:00
qemuDomainCleanupRemove: s/memmove/VIR_DELETE_ELEMENT_INPLACE/
The last argument of memmove is the amount of bytes to be moved. The amount is in Bytes. We are moving some void pointers around. However, since sizeof(void *) is not Byte on any architecture, we've got the arithmetic wrong.
This commit is contained in:
parent
aa0f09929d
commit
ac5f3f292b
@ -2235,12 +2235,9 @@ qemuDomainCleanupRemove(virDomainObjPtr vm,
|
||||
VIR_DEBUG("vm=%s, cb=%p", vm->def->name, cb);
|
||||
|
||||
for (i = 0; i < priv->ncleanupCallbacks; i++) {
|
||||
if (priv->cleanupCallbacks[i] == cb) {
|
||||
memmove(priv->cleanupCallbacks + i,
|
||||
priv->cleanupCallbacks + i + 1,
|
||||
priv->ncleanupCallbacks - i - 1);
|
||||
priv->ncleanupCallbacks--;
|
||||
}
|
||||
if (priv->cleanupCallbacks[i] == cb)
|
||||
VIR_DELETE_ELEMENT_INPLACE(priv->cleanupCallbacks,
|
||||
i, priv->ncleanupCallbacks);
|
||||
}
|
||||
|
||||
VIR_SHRINK_N(priv->cleanupCallbacks,
|
||||
|
Loading…
Reference in New Issue
Block a user