mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-08-24 09:49:59 +03:00
virLockSpacePreExecRestart: Avoid use-after-free
Recent refactor marked 'object' which is returned from the function as
autofree but forgot to use g_steal_pointer in the return statement to
prevent freeing it.
Fixes: 9a1651f64d
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
@ -472,7 +472,7 @@ virJSONValuePtr virLockSpacePreExecRestart(virLockSpacePtr lockspace)
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
virMutexUnlock(&lockspace->lock);
|
virMutexUnlock(&lockspace->lock);
|
||||||
return object;
|
return g_steal_pointer(&object);
|
||||||
|
|
||||||
error:
|
error:
|
||||||
virMutexUnlock(&lockspace->lock);
|
virMutexUnlock(&lockspace->lock);
|
||||||
|
Reference in New Issue
Block a user