From fc3ce1f81d4e19d744ed4be6f59dc2cb983fdb5e Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 7 Mar 2025 08:39:37 -0400 Subject: [PATCH] MT#55283 safeguard auto cleanup function Change-Id: I4aa6f604a74cb5f6467745bdea214954227dc0eb --- lib/containers.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/containers.h b/lib/containers.h index e8e87e2c9..ae2e06a32 100644 --- a/lib/containers.h +++ b/lib/containers.h @@ -440,7 +440,8 @@ static inline void g_queue_clear_full(GQueue *q, GDestroyNotify free_func) { return type_name##_new_sized(0); \ } \ static inline void type_name##_destroy_ptr(type_name *A) { \ - g_ptr_array_free(&(A)->a, TRUE); \ + if (A) \ + g_ptr_array_free(&(A)->a, TRUE); \ } \ G_DEFINE_AUTOPTR_CLEANUP_FUNC(type_name, type_name##_destroy_ptr)