aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmdsserver/client-list.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/libmdsserver/client-list.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/libmdsserver/client-list.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libmdsserver/client-list.c b/src/libmdsserver/client-list.c
index 5562747..1bcaa72 100644
--- a/src/libmdsserver/client-list.c
+++ b/src/libmdsserver/client-list.c
@@ -101,6 +101,7 @@ int client_list_clone(const client_list_t* restrict this, client_list_t* restric
{
size_t n = this->capacity * sizeof(uint64_t);
uint64_t* restrict new_clients = NULL;
+ int saved_errno;
out->clients = NULL;
@@ -116,8 +117,9 @@ int client_list_clone(const client_list_t* restrict this, client_list_t* restric
return 0;
pfail:
+ saved_errno = errno;
free(new_clients);
- return -1;
+ return errno = saved_errno, -1;
}