summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-string.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/wee-string.c b/src/core/wee-string.c
index c79a59f43..8770d1eb2 100644
--- a/src/core/wee-string.c
+++ b/src/core/wee-string.c
@@ -1752,8 +1752,13 @@ string_split_internal (const char *string, const char *separators, int keep_eol,
return NULL;
string2 = string_strip (string, 1, (keep_eol == 2) ? 0 : 1, separators);
- if (!string2 || !string2[0])
+ if (!string2)
return NULL;
+ if (!string2[0])
+ {
+ free (string2);
+ return NULL;
+ }
/* calculate number of items */
ptr = string2;