Skip to content

Commit

Permalink
target/ppc: fix memory leak in kvmppc_is_mem_backend_page_size_ok()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
gkurz authored and dgibson committed Jun 8, 2017
1 parent ec69355 commit 2d3e302
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions target/ppc/kvm.c
Expand Up @@ -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();
}
Expand Down

0 comments on commit 2d3e302

Please sign in to comment.