Skip to content

Commit

Permalink
container: don't leak container reference
Browse files Browse the repository at this point in the history
object_property_add_child() references the child, unref it after to
avoid ref leaks.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
  • Loading branch information
elmarco committed May 4, 2017
1 parent 315dd72 commit f8df5f9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions qom/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit f8df5f9

Please sign in to comment.