summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2016-11-01 11:37:49 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2016-11-01 11:37:49 +0100
commit17fe57d8dcc89aea520788914b252cf49cf060ff (patch)
treed31c0cdbd89d66cdc6de607252bf0915e563ea5e /lib
parent3213273d8261c69a343fcd7d4c9607385dfdbb65 (diff)
Log: Fix broken syslog name
BIRD passed string from configuration to openlog(), which kept it internally. After reconfiguration the old string was freed, therefore openlog had invalid copy. Thanks to Chris Caputo for the original patch.
Diffstat (limited to 'lib')
-rw-r--r--lib/string.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/string.h b/lib/string.h
index 9af49b9e..bf0b7cb0 100644
--- a/lib/string.h
+++ b/lib/string.h
@@ -30,6 +30,15 @@ static inline char *xbasename(const char *str)
return s ? s+1 : (char *) str;
}
+static inline char *
+xstrdup(const char *c)
+{
+ size_t l = strlen(c) + 1;
+ char *z = xmalloc(l);
+ memcpy(z, c, l);
+ return z;
+}
+
#define ROUTER_ID_64_LENGTH 23
#endif