summaryrefslogtreecommitdiffstats
path: root/qom
diff options
context:
space:
mode:
authorMarc-André Lureau2016-12-14 20:42:55 +0100
committerMarc-André Lureau2017-05-04 13:34:41 +0200
commitf8df5f922152a47b3889921d249e00dab766d950 (patch)
treed598aea802152b2bfc63470c4e0a4831564e7394 /qom
parentxen: use a better chardev type check (diff)
downloadqemu-f8df5f922152a47b3889921d249e00dab766d950.tar.gz
qemu-f8df5f922152a47b3889921d249e00dab766d950.tar.xz
qemu-f8df5f922152a47b3889921d249e00dab766d950.zip
container: don't leak container reference
object_property_add_child() references the child, unref it after to avoid ref leaks. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'qom')
-rw-r--r--qom/container.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/qom/container.c b/qom/container.c
index c9eb49b01e..f6ccaf7ea7 100644
--- a/qom/container.c
+++ b/qom/container.c
@@ -40,6 +40,7 @@ Object *container_get(Object *root, const char *path)
if (!child) {
child = object_new("container");
object_property_add_child(obj, parts[i], child, NULL);
+ object_unref(child);
}
}