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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sc_parse.c b/src/sc_parse.c
index ef9f3da..60a03ff 100644
--- a/src/sc_parse.c
+++ b/src/sc_parse.c
@@ -556,6 +556,10 @@ SCBlock *find_last_child(SCBlock *bl)
void sc_insert_text(SCBlock *b1, int o1, const char *t)
{
+ if ( b1->contents == NULL ) {
+ b1->contents = strdup(t);
+ return;
+ }
size_t len = strlen(b1->contents)+1+strlen(t);
char *cnew = realloc(b1->contents, len);
char *tmp = malloc(len);