From 71318d7d685f8e1e112076f84ef2d788acb83547 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 11 Dec 2013 09:34:47 +0100 Subject: [PATCH] shadow_copy2: revert expensive and unnecessary zero-initialization I was being overly cautious. This is initialization is not necessary, since further down in the for-loop, the memory always gets fully initialized because the insert string is inserted at various slash positions. So this talloc_zero_array can be skipped: this an expensive thing to do in virtually every VFS call. This essentially reverts commit 249e9b4a34d8959bd94735c1921ecfc24d6a2705. Signed-off-by: Michael Adam Reviewed-by: Andreas Schneider --- source3/modules/vfs_shadow_copy2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index 8243f6329d0..7f5aeb24e3a 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -482,7 +482,7 @@ static char *shadow_copy2_convert(TALLOC_CTX *mem_ctx, } insertlen = talloc_get_size(insert)-1; - converted = talloc_zero_array(mem_ctx, char, pathlen + insertlen + 1); + converted = talloc_array(mem_ctx, char, pathlen + insertlen + 1); if (converted == NULL) { goto fail; } -- 2.34.1