diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/socket_wrapper.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index f1f0036..9c16e1a 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -1928,15 +1928,20 @@ static void swrap_remove_stale(int fd) return; } + SWRAP_LOG(SWRAP_LOG_TRACE, "remove stale wrapper for %d", fd); + si_index = fi->si_index; - SWRAP_LOG(SWRAP_LOG_TRACE, "remove stale wrapper for %d", fd); + si = swrap_get_socket_info(si_index); + SWRAP_DLIST_REMOVE(socket_fds, fi); - free(fi); - si = swrap_get_socket_info(si_index); + swrap_set_next_free(si, first_free); + first_free = si_index; swrap_dec_refcount(si); + free(fi); + if (swrap_get_refcount(si) > 0) { return; } @@ -1944,9 +1949,6 @@ static void swrap_remove_stale(int fd) if (si->un_addr.sun_path[0] != '\0') { unlink(si->un_addr.sun_path); } - - swrap_set_next_free(si, first_free); - first_free = si_index; } static int sockaddr_convert_to_un(struct socket_info *si, |