@samitouri / QOSamiQemu / commits / 4dec6f135f

hw/core/resetcontainer: free children array on finalization

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 <peter.maydell@linaro.org> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Marc-André Lureau committed Apr 27, 2026 at 14:47 UTC 4dec6f135f956134f2d6d9b50097abfd6e7e2741
1 file changed +3
hw/core/resetcontainer.c
+3
@@ -66,6 +66,9 @@ static void resettable_container_init(Object *obj)
66
67 static void resettable_container_finalize(Object *obj)
68 {
69 + ResettableContainer *rc = RESETTABLE_CONTAINER(obj);
70 +
71 + g_ptr_array_unref(rc->children);
72 }
73
74 static void resettable_container_class_init(ObjectClass *klass,