diff options
author | Swen Schillig <swen@vnet.ibm.com> | 2018-03-07 14:40:33 +0100 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2018-06-22 11:57:19 +0200 |
commit | fb3ddb48741e9e9699cf6efab70192a45f49573e (patch) | |
tree | 830e748b9bbb2a053a79b248935b595c3c6cb503 /ctdb/common | |
parent | 5e89a23ffaceccdc83d70a4ab2798ae25c10d580 (diff) | |
download | samba-fb3ddb48741e9e9699cf6efab70192a45f49573e.tar.gz |
ctdb-common: replace talloc / memcpy by talloc_memdup
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Jun 22 11:57:19 CEST 2018 on sn-devel-144
Diffstat (limited to 'ctdb/common')
-rw-r--r-- | ctdb/common/ctdb_io.c | 5 |
1 files changed, 2 insertions, 3 deletions
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) { |