summaryrefslogtreecommitdiff
path: root/source4/lib/talloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/talloc.c')
-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);
}