commit 0f87071: [Minor] Restore mempool_strdup bahaviour when arg is NULL
Vsevolod Stakhov
vsevolod at rspamd.com
Thu Aug 17 11:49:20 UTC 2023
Author: Vsevolod Stakhov
Date: 2023-08-17 11:47:02 +0100
URL: https://github.com/rspamd/rspamd/commit/0f870719446175344b36db504c08f8e5773a8348
[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);
}
More information about the Commits
mailing list