aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/str_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/str_util.c')
-rw-r--r--src/libutil/str_util.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c
index 9f4ad1cb0..8fcaca484 100644
--- a/src/libutil/str_util.c
+++ b/src/libutil/str_util.c
@@ -3067,7 +3067,11 @@ rspamd_str_make_utf_valid (const guchar *src, gsize slen,
}
if (slen == 0) {
- return NULL;
+ if (dstlen) {
+ *dstlen = 0;
+ }
+
+ return pool ? rspamd_mempool_strdup (pool, "") : g_strdup ("");
}
p = src;