From: Swen Schillig Date: Wed, 7 Mar 2018 13:40:33 +0000 (+0100) Subject: ctdb-common: replace talloc / memcpy by talloc_memdup X-Git-Tag: tevent-0.9.37~244 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fb3ddb48741e9e9699cf6efab70192a45f49573e;p=thirdparty%2Fsamba.git ctdb-common: replace talloc / memcpy by talloc_memdup Signed-off-by: Swen Schillig Reviewed-by: Volker Lendecke Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Fri Jun 22 11:57:19 CEST 2018 on sn-devel-144 --- diff --git a/ctdb/common/ctdb_io.c b/ctdb/common/ctdb_io.c index 3e732e8527d..c6941241883 100644 --- a/ctdb/common/ctdb_io.c +++ b/ctdb/common/ctdb_io.c @@ -117,12 +117,11 @@ static void queue_process(struct ctdb_queue *queue) } /* Extract complete packet */ - data = talloc_size(queue, pkt_size); + data = talloc_memdup(queue, queue->buffer.data, pkt_size); if (data == NULL) { - DEBUG(DEBUG_ERR, ("read error alloc failed for %u\n", pkt_size)); + D_ERR("read error alloc failed for %u\n", pkt_size); return; } - memcpy(data, queue->buffer.data, pkt_size); /* Shift packet out from buffer */ if (queue->buffer.length > pkt_size) {