summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/socket_wrapper.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index ed42b2d..6c9ec51 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -2015,8 +2015,6 @@ static void swrap_remove_stale(int fd)
SWRAP_DLIST_REMOVE(socket_fds, fi);
- swrap_set_next_free(si, first_free);
- first_free = si_index;
swrap_dec_refcount(si);
free(fi);
@@ -2029,6 +2027,9 @@ static void swrap_remove_stale(int fd)
unlink(si->un_addr.sun_path);
}
+ swrap_set_next_free(si, first_free);
+ first_free = si_index;
+
out:
SWRAP_UNLOCK_SI(si);
SWRAP_UNLOCK(first_free);
@@ -5887,9 +5888,6 @@ static int swrap_close(int fd)
ret = libc_close(fd);
- swrap_set_next_free(si, first_free);
- first_free = si_index;
-
swrap_dec_refcount(si);
free(fi);
@@ -5912,6 +5910,9 @@ static int swrap_close(int fd)
unlink(si->un_addr.sun_path);
}
+ swrap_set_next_free(si, first_free);
+ first_free = si_index;
+
out:
SWRAP_UNLOCK_SI(si);
SWRAP_UNLOCK(first_free);