diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/talloc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/lib/talloc.c b/source4/lib/talloc.c index f61ef6d906..9f873a2d6b 100644 --- a/source4/lib/talloc.c +++ b/source4/lib/talloc.c @@ -464,7 +464,11 @@ char *talloc_strndup(TALLOC_CTX *t, const char *p, size_t n) VA_COPY(ap2, ap); - s_len = strlen(s); + if (s) { + s_len = strlen(s); + } else { + s = 0; + } len = vsnprintf(NULL, 0, fmt, ap2); s = talloc_realloc(t, s, s_len + len+1); |