summaryrefslogtreecommitdiffstats
path: root/source/lib/talloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/lib/talloc.c')
-rw-r--r--source/lib/talloc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/lib/talloc.c b/source/lib/talloc.c
index 6ac784a9297..b50e451b950 100644
--- a/source/lib/talloc.c
+++ b/source/lib/talloc.c
@@ -287,6 +287,15 @@ char *talloc_strdup(TALLOC_CTX *t, const char *p)
return NULL;
}
+/** strdup_w with a talloc */
+smb_ucs2_t *talloc_strdup_w(TALLOC_CTX *t, const smb_ucs2_t *p)
+{
+ if (p)
+ return talloc_memdup(t, p, (strlen_w(p) + 1) * sizeof(smb_ucs2_t));
+ else
+ return NULL;
+}
+
/**
* Perform string formatting, and return a pointer to newly allocated
* memory holding the result, inside a memory pool.