From: Greg Kurz <gr...@kaod.org>

The string returned by object_property_get_str() is dynamically allocated.

Signed-off-by: Greg Kurz <gr...@kaod.org>
Message-Id: <152231458624.69730.1752893648612848392.st...@bahia.lan>
Reviewed-by: Cornelia Huck <coh...@redhat.com>
Reviewed-by: Thomas Huth <th...@redhat.com>
Signed-off-by: Eduardo Habkost <ehabk...@redhat.com>
(cherry picked from commit 72a841d2a403b56ff894fa007b172dc9bcb3dae8)
Signed-off-by: Michael Roth <mdr...@linux.vnet.ibm.com>
---
 exec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/exec.c b/exec.c
index 5f8017a5d7..e60ad94a42 100644
--- a/exec.c
+++ b/exec.c
@@ -1455,6 +1455,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;
             }
-- 
2.11.0


Reply via email to