log BUGFIX handle append to empty string
diff --git a/src/log.c b/src/log.c
index 742ddb3..feaef5f 100644
--- a/src/log.c
+++ b/src/log.c
@@ -770,7 +770,7 @@
     }
 
     /* realloc string */
-    len = strlen(*str);
+    len = *str ? strlen(*str) : 0;
     new_len = len + 1 + (mod ? strlen(mod->name) + 1 : 0) + strlen(snode->name);
     mem = realloc(*str, new_len + 1);
     LY_CHECK_ERR_RET(!mem, LOGMEM(LYD_CTX(parent)), LY_EMEM);