summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/util.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 7053fdc266..82c4822a86 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -2367,10 +2367,9 @@ bool parent_dirname_talloc(TALLOC_CTX *mem_ctx, const char *dir,
len = p-dir;
- if (!(*parent = TALLOC_ARRAY(mem_ctx, char, len+1))) {
+ if (!(*parent = (char *)TALLOC_MEMDUP(mem_ctx, dir, len+1))) {
return False;
}
- memcpy(*parent, dir, len);
(*parent)[len] = '\0';
if (name) {