summaryrefslogtreecommitdiffstats
path: root/target/ppc/kvm.c
diff options
context:
space:
mode:
authorGreg Kurz2017-06-06 17:22:53 +0200
committerDavid Gibson2017-06-08 03:05:31 +0200
commit2d3e302ec2246d703ffa8d8f8769a3fa448d8145 (patch)
treec769baf856ac5a0683f389a29cc972537230e8a5 /target/ppc/kvm.c
parenttarget/ppc: pass const string to kvmppc_is_mem_backend_page_size_ok() (diff)
downloadqemu-2d3e302ec2246d703ffa8d8f8769a3fa448d8145.tar.gz
qemu-2d3e302ec2246d703ffa8d8f8769a3fa448d8145.tar.xz
qemu-2d3e302ec2246d703ffa8d8f8769a3fa448d8145.zip
target/ppc: fix memory leak in kvmppc_is_mem_backend_page_size_ok()
The string returned by object_property_get_str() is dynamically allocated. Signed-off-by: Greg Kurz <groug@kaod.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target/ppc/kvm.c')
-rw-r--r--target/ppc/kvm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 8881762076..f2f7c531bc 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -486,6 +486,7 @@ bool kvmppc_is_mem_backend_page_size_ok(const char *obj_path)
if (mempath) {
pagesize = qemu_mempath_getpagesize(mempath);
+ g_free(mempath);
} else {
pagesize = getpagesize();
}