From 0f870719446175344b36db504c08f8e5773a8348 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 17 Aug 2023 11:47:02 +0100 Subject: [PATCH] [Minor] Restore mempool_strdup bahaviour when arg is NULL --- src/libutil/mem_pool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libutil/mem_pool.c b/src/libutil/mem_pool.c index edfb3c016..bbd302a23 100644 --- a/src/libutil/mem_pool.c +++ b/src/libutil/mem_pool.c @@ -605,6 +605,9 @@ rspamd_mempool_alloc_shared_(rspamd_mempool_t *pool, gsize size, gsize alignment gchar * rspamd_mempool_strdup_(rspamd_mempool_t *pool, const gchar *src, const gchar *loc) { + if (src == NULL) { + return NULL; + } return rspamd_mempool_strdup_len_(pool, src, strlen(src), loc); } -- 2.39.5