summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-12-24 13:18:35 +0100
committerVolker Lendecke <vl@samba.org>2008-12-31 19:33:24 +0100
commit8a507b1e7fa179c16c2dd6ddc2bdd345d00545f4 (patch)
tree3426022c36f5a363c457ba5f335571958cda6a59 /source3/lib
parentadd3d572d05951f6f5ac89044d449c4dbdc03308 (diff)
downloadsamba-8a507b1e7fa179c16c2dd6ddc2bdd345d00545f4.tar.gz
samba-8a507b1e7fa179c16c2dd6ddc2bdd345d00545f4.tar.bz2
samba-8a507b1e7fa179c16c2dd6ddc2bdd345d00545f4.zip
Make use of TALLOC_MEMDUP in parent_dirname_talloc()
Diffstat (limited to 'source3/lib')
-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) {