summaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 4975dfa917..3055ac2750 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -592,6 +592,10 @@ esc_for_log(const char *s)
const char *cp;
char *result, *outp;
size_t len = 3;
+ if (!s) {
+ return tor_strdup("");
+ }
+
for (cp = s; *cp; ++cp) {
switch (*cp) {
case '\\':