aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-server/mds-server.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-12-08 19:28:41 +0100
committerMattias Andrée <maandree@operamail.com>2014-12-08 19:28:41 +0100
commit718a400d599f3df3a64c2c0659a48fb9d22b6105 (patch)
tree48041ab3edec8580781fc37c201f6fb7e6794d51 /src/mds-server/mds-server.c
parentno more goto fail (diff)
downloadmds-718a400d599f3df3a64c2c0659a48fb9d22b6105.tar.gz
mds-718a400d599f3df3a64c2c0659a48fb9d22b6105.tar.bz2
mds-718a400d599f3df3a64c2c0659a48fb9d22b6105.tar.xz
m + make sure we never lose errno
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mds-server/mds-server.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mds-server/mds-server.c b/src/mds-server/mds-server.c
index 499ba96..abfc871 100644
--- a/src/mds-server/mds-server.c
+++ b/src/mds-server/mds-server.c
@@ -403,6 +403,7 @@ void queue_message_multicast(char* message, size_t length, client_t* sender)
uint64_t modify_id;
char modify_id_header[13 + 3 * sizeof(uint64_t)];
void* new_buf;
+ int saved_errno;
/* Count the number of headers. */
for (i = 0; i < n; i++)
@@ -440,7 +441,7 @@ void queue_message_multicast(char* message, size_t length, client_t* sender)
*colon = '\0';
if ((headers[i] = strdup(msg)) == NULL)
{
- free(headers[i]);
+ saved_errno = errno, free(headers[i]), errno = saved_errno;
header_count = i;
fail_if (1);
}