From: Marc-André Lureau <[email protected]>
resettable_container_init allocates a GPtrArray for children, but
resettable_container_finalize was empty and never freed it.
Fixes: 4c046ce37af0 ("hw/core: Add ResetContainer which holds objects
implementing Resettable")
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Marc-André Lureau <[email protected]>
---
hw/core/resetcontainer.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/core/resetcontainer.c b/hw/core/resetcontainer.c
index ef84aa2374a..a4a6476a036 100644
--- a/hw/core/resetcontainer.c
+++ b/hw/core/resetcontainer.c
@@ -66,6 +66,9 @@ static void resettable_container_init(Object *obj)
static void resettable_container_finalize(Object *obj)
{
+ ResettableContainer *rc = RESETTABLE_CONTAINER(obj);
+
+ g_ptr_array_unref(rc->children);
}
static void resettable_container_class_init(ObjectClass *klass,
--
2.54.0