aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-server/client.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-12-10 02:58:25 +0100
committerMattias Andrée <maandree@operamail.com>2014-12-10 02:58:25 +0100
commit344273a7e0a6899451836e6072fecebea4a6ac24 (patch)
treeea24fa9e12ae6dad40eeb6470c92545e14f0f8cf /src/mds-server/client.c
parentno more direct allocations, always use macros, unless using alloca (diff)
downloadmds-344273a7e0a6899451836e6072fecebea4a6ac24.tar.gz
mds-344273a7e0a6899451836e6072fecebea4a6ac24.tar.bz2
mds-344273a7e0a6899451836e6072fecebea4a6ac24.tar.xz
add xmemdup macro
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mds-server/client.c6
1 files changed, 2 insertions, 4 deletions
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)