diff options
author | Andrew Bartlett <abartlet@samba.org> | 2004-07-13 03:23:55 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:57:33 -0500 |
commit | 39b12015846e06cbf89079e365e6c228ca3883c2 (patch) | |
tree | b254da7b963bde1b4304e26268bc5c566636a437 | |
parent | 3a6f761eb061d93837038f0aa75c2ffcb0ba3639 (diff) | |
download | samba-39b12015846e06cbf89079e365e6c228ca3883c2.tar.gz samba-39b12015846e06cbf89079e365e6c228ca3883c2.tar.bz2 samba-39b12015846e06cbf89079e365e6c228ca3883c2.zip |
r1474: It is useful if talloc_strdup() behaves like strdup()
- NULL in, NULL out
Andrew Bartlett
(This used to be commit 2cc0b3a2f1785c53268f018999a87c26539fd4a6)
-rw-r--r-- | source4/lib/talloc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source4/lib/talloc.c b/source4/lib/talloc.c index 9f873a2d6b..421a09e3c6 100644 --- a/source4/lib/talloc.c +++ b/source4/lib/talloc.c @@ -381,6 +381,9 @@ void *talloc_memdup(TALLOC_CTX *t, const void *p, size_t size) /** strdup with a talloc */ char *talloc_strdup(TALLOC_CTX *t, const char *p) { + if (!p) { + return NULL; + } return talloc_memdup(t, p, strlen(p) + 1); } |