From: Ondřej Surý Date: Thu, 12 Dec 2019 11:59:39 +0000 (+0100) Subject: Add missing isc_refcount_destroy and lock the socket ISC_LISTS in destroy() X-Git-Tag: v9.15.7~2^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d35739d5168b34c2f219b6663f0d42f207ef877d;p=thirdparty%2Fbind9.git Add missing isc_refcount_destroy and lock the socket ISC_LISTS in destroy() --- diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index 7b7c8fc2bab..9cff8de2189 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -1832,15 +1832,17 @@ destroy(isc__socket_t **sockp) { isc__socketmgr_t *manager = sock->manager; isc__socketthread_t *thread = NULL; + isc_refcount_destroy(&sock->references); + socket_log(sock, NULL, CREATION, "destroying"); + LOCK(&sock->lock); INSIST(ISC_LIST_EMPTY(sock->connect_list)); INSIST(ISC_LIST_EMPTY(sock->accept_list)); INSIST(ISC_LIST_EMPTY(sock->recv_list)); INSIST(ISC_LIST_EMPTY(sock->send_list)); INSIST(sock->fd >= -1 && sock->fd < (int)manager->maxsocks); - LOCK(&sock->lock); if (sock->fd >= 0) { fd = sock->fd; thread = &manager->threads[sock->threadid];