summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Bloomfield <PeterBloomfield@bellsouth.net>2022-10-09 19:39:58 -0400
committerPeter Bloomfield <PeterBloomfield@bellsouth.net>2022-10-09 19:39:58 -0400
commit574a2ecfa9472410cf382a4fb545fe41fe0d5128 (patch)
treea9df79a9e350c56edd09f0abedb83ae8df9bd468
parent2b8b866bae578d66e46caf96bf617a75a2fd8fa6 (diff)
downloadglib-574a2ecfa9472410cf382a4fb545fe41fe0d5128.tar.gz
gdatetime: add NULL guard in g_date_time_new_now()
Add a missing g_return_() check in g_date_time_new_now(). A clear warning is better than a NULL pointer dereference.
-rw-r--r--glib/gdatetime.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/glib/gdatetime.c b/glib/gdatetime.c
index db746564d..a9c472e55 100644
--- a/glib/gdatetime.c
+++ b/glib/gdatetime.c
@@ -959,6 +959,8 @@ g_date_time_new_now (GTimeZone *tz)
{
gint64 now_us;
+ g_return_val_if_fail (tz != NULL, NULL);
+
now_us = g_get_real_time ();
return g_date_time_new_from_unix (tz, now_us);