mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 05:57:52 +00:00
several dynamic memory allocations used the size of the wrong structure
(which coincidentally had the same size as the right one)
This commit is contained in:
parent
93a6dd9d38
commit
10cd4cf39c
@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dighost.c,v 1.179 2001/01/08 23:40:29 bwelling Exp $ */
|
/* $Id: dighost.c,v 1.180 2001/01/08 23:44:09 gson Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Notice to programmers: Do not use this code as an example of how to
|
* Notice to programmers: Do not use this code as an example of how to
|
||||||
@ -640,8 +640,7 @@ setup_system(void) {
|
|||||||
debug("adding search %s",
|
debug("adding search %s",
|
||||||
ptr);
|
ptr);
|
||||||
search = isc_mem_allocate(
|
search = isc_mem_allocate(
|
||||||
mctx, sizeof(struct
|
mctx, sizeof(*search));
|
||||||
dig_server));
|
|
||||||
if (search == NULL)
|
if (search == NULL)
|
||||||
fatal("Memory "
|
fatal("Memory "
|
||||||
"allocation "
|
"allocation "
|
||||||
@ -664,8 +663,7 @@ setup_system(void) {
|
|||||||
while ((ptr = next_token(&input, " \t\r\n"))
|
while ((ptr = next_token(&input, " \t\r\n"))
|
||||||
!= NULL) {
|
!= NULL) {
|
||||||
search = isc_mem_allocate(
|
search = isc_mem_allocate(
|
||||||
mctx, sizeof(struct
|
mctx, sizeof(*search));
|
||||||
dig_server));
|
|
||||||
if (search == NULL)
|
if (search == NULL)
|
||||||
fatal("Memory "
|
fatal("Memory "
|
||||||
"allocation "
|
"allocation "
|
||||||
@ -1293,7 +1291,7 @@ setup_lookup(dig_lookup_t *lookup) {
|
|||||||
if (fixedsearch != NULL)
|
if (fixedsearch != NULL)
|
||||||
isc_mem_free(mctx, fixedsearch);
|
isc_mem_free(mctx, fixedsearch);
|
||||||
fixedsearch = isc_mem_allocate(mctx,
|
fixedsearch = isc_mem_allocate(mctx,
|
||||||
sizeof(struct dig_server));
|
sizeof(*fixedsearch));
|
||||||
if (fixedsearch == NULL)
|
if (fixedsearch == NULL)
|
||||||
fatal("Memory allocation failure in %s:%d",
|
fatal("Memory allocation failure in %s:%d",
|
||||||
__FILE__, __LINE__);
|
__FILE__, __LINE__);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user