CID 452336: Passing freed pointer "csock" as an argument to "isc__nm_accept_connection_log"
Coverity Scan claims the following two issues, likely rooted in #3985 (closed).
/lib/isc/netmgr/tcp.c: 818 in tcpaccept_cb()
812 isc_nmsocket_t *sock = arg;
813
814 REQUIRE(VALID_NMSOCK(sock));
815 REQUIRE(sock->tid == isc_tid());
816
817 isc_result_t result = accept_connection(sock);
>>> CID 452335: Memory - illegal accesses (USE_AFTER_FREE)
>>> Passing freed pointer "sock" as an argument to "isc__nm_accept_connection_log".
818 isc__nm_accept_connection_log(sock, result, can_log_tcp_quota());
819 isc__nmsocket_detach(&sock);
820 }
821
822 static void
823 quota_accept_cb(void *arg) {
/lib/isc/netmgr/tcp.c: 834 in quota_accept_cb()
828 /*
829 * This needs to be asynchronous, because the quota might have been
830 * released by a different child socket.
831 */
832 if (csock->tid == isc_tid()) {
833 isc_result_t result = accept_connection(csock);
>>> CID 452336: Memory - illegal accesses (USE_AFTER_FREE)
>>> Passing freed pointer "csock" as an argument to "isc__nm_accept_connection_log".
834 isc__nm_accept_connection_log(csock, result,
835 can_log_tcp_quota());
836 } else {
837 isc__nmsocket_attach(csock, &(isc_nmsocket_t *){ NULL });
838 isc_async_run(csock->worker->loop, tcpaccept_cb, csock);
839 }