summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-07-13 03:23:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:57:33 -0500
commit39b12015846e06cbf89079e365e6c228ca3883c2 (patch)
treeb254da7b963bde1b4304e26268bc5c566636a437 /source4
parent3a6f761eb061d93837038f0aa75c2ffcb0ba3639 (diff)
downloadsamba-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)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/talloc.c3
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);
}