mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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:
parent
55d175c073
commit
6b8e961399
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user