Commit d1a5fdc3 authored by Mark Andrews's avatar Mark Andrews
Browse files

2955. [bug] The size of a memory allocation was not always properly

                        recorded. [RT #20927]
parent 2e20dea9
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 2854. [func] nsupdate will now preserve the entered case of domain
names in update requests it sends. [RT #20928] names in update requests it sends. [RT #20928]
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE. * 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 */ /*! \file */
...@@ -75,7 +75,7 @@ struct debuglink { ...@@ -75,7 +75,7 @@ struct debuglink {
}; };
#define FLARG_PASS , file, line #define FLARG_PASS , file, line
#define FLARG , const char *file, int line #define FLARG , const char *file, unsigned int line
#else #else
#define FLARG_PASS #define FLARG_PASS
#define FLARG #define FLARG
...@@ -394,6 +394,7 @@ add_trace_entry(isc__mem_t *mctx, const void *ptr, unsigned int size ...@@ -394,6 +394,7 @@ add_trace_entry(isc__mem_t *mctx, const void *ptr, unsigned int size
{ {
debuglink_t *dl; debuglink_t *dl;
unsigned int i; unsigned int i;
unsigned int mysize = size;
if ((isc_mem_debugging & ISC_MEM_DEBUGTRACE) != 0) if ((isc_mem_debugging & ISC_MEM_DEBUGTRACE) != 0)
fprintf(stderr, isc_msgcat_get(isc_msgcat, ISC_MSGSET_MEM, 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 ...@@ -405,10 +406,10 @@ add_trace_entry(isc__mem_t *mctx, const void *ptr, unsigned int size
if (mctx->debuglist == NULL) if (mctx->debuglist == NULL)
return; return;
if (size > mctx->max_size) if (mysize > mctx->max_size)
size = mctx->max_size; mysize = mctx->max_size;
dl = ISC_LIST_HEAD(mctx->debuglist[size]); dl = ISC_LIST_HEAD(mctx->debuglist[mysize]);
while (dl != NULL) { while (dl != NULL) {
if (dl->count == DEBUGLIST_COUNT) if (dl->count == DEBUGLIST_COUNT)
goto next; goto next;
...@@ -443,7 +444,7 @@ add_trace_entry(isc__mem_t *mctx, const void *ptr, unsigned int size ...@@ -443,7 +444,7 @@ add_trace_entry(isc__mem_t *mctx, const void *ptr, unsigned int size
dl->line[0] = line; dl->line[0] = line;
dl->count = 1; dl->count = 1;
ISC_LIST_PREPEND(mctx->debuglist[size], dl, link); ISC_LIST_PREPEND(mctx->debuglist[mysize], dl, link);
mctx->debuglistcnt++; mctx->debuglistcnt++;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment