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>
This commit is contained in:
Marc-André Lureau 2016-12-14 22:42:55 +03:00
parent 315dd72d75
commit f8df5f9221

View File

@ -40,6 +40,7 @@ Object *container_get(Object *root, const char *path)
if (!child) { if (!child) {
child = object_new("container"); child = object_new("container");
object_property_add_child(obj, parts[i], child, NULL); object_property_add_child(obj, parts[i], child, NULL);
object_unref(child);
} }
} }