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:
parent
315dd72d75
commit
f8df5f9221
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user