From 79be995c0c068af6c90829bdea48a9cd33bb5065 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 12 Apr 2024 17:43:20 +0100 Subject: [PATCH] gtimezone: Add a missing precondition assertion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise scan-build thinks there could be `NULL` pointer dereference of the `tz`. (There can’t be, it’s a false positive. 🤫) Signed-off-by: Philip Withnall Helps: #1767 --- glib/gtimezone.c | 1 + 1 file changed, 1 insertion(+) diff --git a/glib/gtimezone.c b/glib/gtimezone.c index 0c3cae3f7..2b7ed7b85 100644 --- a/glib/gtimezone.c +++ b/glib/gtimezone.c @@ -280,6 +280,7 @@ again: GTimeZone * g_time_zone_ref (GTimeZone *tz) { + g_return_val_if_fail (tz != NULL, NULL); g_assert (tz->ref_count > 0); g_atomic_int_inc (&tz->ref_count);