1562. [bug] isc_socket_create() and isc_socket_accept() could

leak memory under error conditions. [RT #10230]
This commit is contained in:
Mark Andrews 2004-01-26 23:50:40 +00:00
parent cc79bffa78
commit 52c85d05fc
3 changed files with 10 additions and 4 deletions

View file

@ -1,3 +1,6 @@
1562. [bug] isc_socket_create() and isc_socket_accept() could
leak memory under error conditions. [RT #10230]
1561. [bug] It was possible to release the same name twice if
named ran out of memory. [RT #10197]

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: socket.c,v 1.207.2.19.2.3 2003/08/15 01:16:06 marka Exp $ */
/* $Id: socket.c,v 1.207.2.19.2.4 2004/01/26 23:50:40 marka Exp $ */
#include <config.h>
@ -1246,7 +1246,8 @@ allocate_socket(isc_socketmgr_t *manager, isc_sockettype_t type,
return (ISC_R_SUCCESS);
error: /* socket allocated */
error:
isc_mem_put(manager->mctx, sock, sizeof(*sock));
return (ret);
}

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: socket.c,v 1.5.2.13.2.5 2004/01/08 08:23:52 marka Exp $ */
/* $Id: socket.c,v 1.5.2.13.2.6 2004/01/26 23:50:40 marka Exp $ */
/* This code has been rewritten to take advantage of Windows Sockets
* I/O Completion Ports and Events. I/O Completion Ports is ONLY
@ -1754,10 +1754,12 @@ allocate_socket(isc_socketmgr_t *manager, isc_sockettype_t type,
return (ISC_R_SUCCESS);
error: /* socket allocated */
error:
isc_mem_put(manager->mctx, sock, sizeof(*sock));
return (ret);
}
/*
* This event requires that the various lists be empty, that the reference
* count be 1, and that the magic number is valid. The other socket bits,