aboutsummaryrefslogtreecommitdiff
path: root/src/sc_parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sc_parse.c')
-rw-r--r--src/sc_parse.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/sc_parse.c b/src/sc_parse.c
index 4838bc6..3853800 100644
--- a/src/sc_parse.c
+++ b/src/sc_parse.c
@@ -786,10 +786,13 @@ SCBlock *sc_block_split(SCBlock *bl, size_t pos)
/* Second block */
n->name = s_strdup(bl->name);
n->options = s_strdup(bl->options);
- n->contents = strdup(bl->contents+pos);
-
- /* Truncate the first block */
- bl->contents[pos] = '\0';
+ if ( bl->contents != NULL ) {
+ n->contents = strdup(bl->contents+pos);
+ /* Truncate the first block */
+ bl->contents[pos] = '\0';
+ } else {
+ n->contents = NULL;
+ }
n->next = bl->next;
bl->next = n;