From 344273a7e0a6899451836e6072fecebea4a6ac24 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 10 Dec 2014 02:58:25 +0100 Subject: add xmemdup macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-server/client.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/mds-server/client.c') diff --git a/src/mds-server/client.c b/src/mds-server/client.c index f72a2ce..a59873e 100644 --- a/src/mds-server/client.c +++ b/src/mds-server/client.c @@ -251,10 +251,8 @@ size_t client_unmarshal(client_t* restrict this, char* restrict data) buf_get_next(data, size_t, this->send_pending_size); if (this->send_pending_size > 0) { - fail_if (xmalloc(this->send_pending, this->send_pending_size, char)); - memcpy(this->send_pending, data, this->send_pending_size * sizeof(char)); - data += this->send_pending_size; - rc += this->send_pending_size * sizeof(char); + fail_if (xmemdup(this->send_pending, data, this->send_pending_size, char)); + data += this->send_pending_size, rc += this->send_pending_size * sizeof(char); } buf_get_next(data, size_t, n); if (n > 0) -- cgit v1.2.3-70-g09d2