diff --git a/CHANGES b/CHANGES index a67cd5202d..2dfe4c04c9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +2955. [bug] The size of a memory allocation was not always properly + recorded. [RT #20927] + 2854. [func] nsupdate will now preserve the entered case of domain names in update requests it sends. [RT #20928] diff --git a/lib/isc/mem.c b/lib/isc/mem.c index ef6ece0c29..6530892727 100644 --- a/lib/isc/mem.c +++ b/lib/isc/mem.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mem.c,v 1.153 2009/09/02 23:43:54 each Exp $ */ +/* $Id: mem.c,v 1.154 2010/03/04 05:29:15 marka Exp $ */ /*! \file */ @@ -75,7 +75,7 @@ struct debuglink { }; #define FLARG_PASS , file, line -#define FLARG , const char *file, int line +#define FLARG , const char *file, unsigned int line #else #define FLARG_PASS #define FLARG @@ -394,6 +394,7 @@ add_trace_entry(isc__mem_t *mctx, const void *ptr, unsigned int size { debuglink_t *dl; unsigned int i; + unsigned int mysize = size; if ((isc_mem_debugging & ISC_MEM_DEBUGTRACE) != 0) fprintf(stderr, isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, @@ -405,10 +406,10 @@ add_trace_entry(isc__mem_t *mctx, const void *ptr, unsigned int size if (mctx->debuglist == NULL) return; - if (size > mctx->max_size) - size = mctx->max_size; + if (mysize > mctx->max_size) + mysize = mctx->max_size; - dl = ISC_LIST_HEAD(mctx->debuglist[size]); + dl = ISC_LIST_HEAD(mctx->debuglist[mysize]); while (dl != NULL) { if (dl->count == DEBUGLIST_COUNT) goto next; @@ -443,7 +444,7 @@ add_trace_entry(isc__mem_t *mctx, const void *ptr, unsigned int size dl->line[0] = line; dl->count = 1; - ISC_LIST_PREPEND(mctx->debuglist[size], dl, link); + ISC_LIST_PREPEND(mctx->debuglist[mysize], dl, link); mctx->debuglistcnt++; }