File 6b8e9613-avoid-use-after-free.patch of Package libvirt
xxxxxxxxxx
1
commit 6b8e961399549c5c8fdf06875e5981c564829ad6
2
Author: Peter Krempa <pkrempa@redhat.com>
3
Date: Fri Mar 12 10:12:51 2021 +0100
4
5
virLockSpacePreExecRestart: Avoid use-after-free
6
7
Recent refactor marked 'object' which is returned from the function as
8
autofree but forgot to use g_steal_pointer in the return statement to
9
prevent freeing it.
10
11
Fixes: 9a1651f64d7
12
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
13
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
14
15
Index: libvirt-7.1.0/src/util/virlockspace.c
16
===================================================================
17
--- libvirt-7.1.0.orig/src/util/virlockspace.c
18
+++ libvirt-7.1.0/src/util/virlockspace.c
19
20
goto error;
21
22
virMutexUnlock(&lockspace->lock);
23
- return object;
24
+ return g_steal_pointer(&object);
25
26
error:
27
virMutexUnlock(&lockspace->lock);
28