[PATCH] lib: Use talloc_memdup in messaging_rec_dup

Volker Lendecke Volker.Lendecke at SerNet.DE
Sat Dec 27 03:51:30 MST 2014


Hi!

Review&push appreciated!

Thanks,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 824c82c2ef132498f3f535fc34759b4cd80c09d9 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Sat, 13 Dec 2014 09:52:42 +0100
Subject: [PATCH] lib: Use talloc_memdup in messaging_rec_dup

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/lib/messages.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index 28bfa22..421258f 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -576,8 +576,7 @@ static struct messaging_rec *messaging_rec_dup(TALLOC_CTX *mem_ctx,
 
 	result->fds = NULL;
 	if (result->num_fds > 0) {
-		result->fds = talloc_array(result, int64_t, result->num_fds);
-		memcpy(result->fds, rec->fds, fds_size);
+		result->fds = talloc_memdup(result, rec->fds, fds_size);
 	}
 
 	return result;
-- 
1.9.1



More information about the samba-technical mailing list