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

recorded. [RT #20927]
This commit is contained in:
Mark Andrews
2010-03-04 05:59:07 +00:00
parent a79df62abf
commit ba97097eaf
3 changed files with 12 additions and 8 deletions
+3
View File
@@ -1,3 +1,6 @@
2955. [bug] The size of a memory allocation was not always properly
recorded. [RT #20927]
2853. [bug] add_sigs() could run out of scratch space. [RT #21015]
2852. [bug] Handle broken DNSSEC trust chains better. [RT #15619]
+2 -2
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: mem.h,v 1.78.120.3 2009/02/11 03:07:01 jinmei Exp $ */
/* $Id: mem.h,v 1.78.120.4 2010/03/04 05:59:07 marka Exp $ */
#ifndef ISC_MEM_H
#define ISC_MEM_H 1
@@ -121,7 +121,7 @@ LIBISC_EXTERNAL_DATA extern unsigned int isc_mem_debugging;
#if ISC_MEM_TRACKLINES
#define _ISC_MEM_FILELINE , __FILE__, __LINE__
#define _ISC_MEM_FLARG , const char *, int
#define _ISC_MEM_FLARG , const char *, unsigned int
#else
#define _ISC_MEM_FILELINE
#define _ISC_MEM_FLARG
+7 -6
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: mem.c,v 1.145.120.4 2009/02/16 03:17:05 marka Exp $ */
/* $Id: mem.c,v 1.145.120.5 2010/03/04 05:59:07 marka Exp $ */
/*! \file */
@@ -72,7 +72,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
@@ -220,6 +220,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,
@@ -231,10 +232,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;
@@ -269,7 +270,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++;
}