diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-12-10 02:58:25 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-12-10 02:58:25 +0100 |
commit | 344273a7e0a6899451836e6072fecebea4a6ac24 (patch) | |
tree | ea24fa9e12ae6dad40eeb6470c92545e14f0f8cf /src/mds-server/receiving.c | |
parent | no more direct allocations, always use macros, unless using alloca (diff) | |
download | mds-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/receiving.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mds-server/receiving.c b/src/mds-server/receiving.c index bc22fe2..e60fb42 100644 --- a/src/mds-server/receiving.c +++ b/src/mds-server/receiving.c @@ -78,8 +78,7 @@ static int modifying_notify(client_t* client, mds_message_t message, uint64_t mo recipient = (client_t*)(void*)address; fail_if (xmalloc(multicast = recipient->modify_message, 1, mds_message_t)); mds_message_zero_initialise(multicast); - fail_if (xmalloc(multicast->payload, message.payload_size, char)); - memcpy(multicast->payload, message.payload, message.payload_size * sizeof(char)); + fail_if (xmemdup(multicast->payload, message.payload, message.payload_size, char)); fail_if (xmalloc(multicast->headers, message.header_count, char*)); for (i = 0; i < message.header_count; i++, multicast->header_count++) fail_if (xstrdup(multicast->headers[i], message.headers[i])); |