commit | 03205432f5b6c0de85f9a901ab203b5377c05f83 | [log] [tgz] |
---|---|---|
author | Michal Vasko <mvasko@cesnet.cz> | Mon Sep 11 10:29:49 2023 +0200 |
committer | Michal Vasko <mvasko@cesnet.cz> | Mon Sep 11 10:29:49 2023 +0200 |
tree | de40fb21cd8ee03ffa9aea3b9bdc17f245d6044b | |
parent | cd9c00b273a2ba53f60b385cc637febccf85d65b [diff] [blame] |
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);