2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

2039. [func] Check that all buffers passed to the socket code

have been retrieve when the socket event is freed.
                        [RT #16122]

2038.   [bug]           dig/nslookup/host was unlinking from wrong list
                        when handling errors. [RT #16122]
This commit is contained in:
Mark Andrews
2006-06-06 00:53:36 +00:00
parent bce4c27420
commit 9a482d1fce
5 changed files with 50 additions and 9 deletions

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: socket.c,v 1.264 2006/05/19 02:47:18 marka Exp $ */
/* $Id: socket.c,v 1.265 2006/06/06 00:53:36 marka Exp $ */
/*! \file */
@@ -891,6 +891,15 @@ set_dev_address(isc_sockaddr_t *address, isc_socket_t *sock,
}
}
static void
destroy_socketevent(isc_event_t *event) {
isc_socketevent_t *ev = (isc_socketevent_t *)event;
INSIST(ISC_LIST_EMPTY(ev->bufferlist));
(ev->destroy)(event);
}
static isc_socketevent_t *
allocate_socketevent(isc_socket_t *sock, isc_eventtype_t eventtype,
isc_taskaction_t action, const void *arg)
@@ -912,6 +921,8 @@ allocate_socketevent(isc_socket_t *sock, isc_eventtype_t eventtype,
ev->n = 0;
ev->offset = 0;
ev->attributes = 0;
ev->destroy = ev->ev_destroy;
ev->ev_destroy = destroy_socketevent;
return (ev);
}