aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2018-03-29 11:09:46 +0200
committerEduardo Habkost <ehabkost@redhat.com>2018-04-02 23:05:15 -0300
commit72a841d2a403b56ff894fa007b172dc9bcb3dae8 (patch)
treeede436b1509d7734cf36e274bcb1d954fa1ab5f3 /exec.c
parentf184de7553272223d6af731d7d623a7cebf710b5 (diff)
exec: fix memory leak in find_max_supported_pagesize()
The string returned by object_property_get_str() is dynamically allocated. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <152231458624.69730.1752893648612848392.stgit@bahia.lan> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index c09bd93df3..02b1efebb7 100644
--- a/exec.c
+++ b/exec.c
@@ -1495,6 +1495,7 @@ static int find_max_supported_pagesize(Object *obj, void *opaque)
mem_path = object_property_get_str(obj, "mem-path", NULL);
if (mem_path) {
long hpsize = qemu_mempath_getpagesize(mem_path);
+ g_free(mem_path);
if (hpsize < *hpsize_min) {
*hpsize_min = hpsize;
}