]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2955. [bug] The size of a memory allocation was not always properly
authorMark Andrews <marka@isc.org>
Thu, 4 Mar 2010 05:29:15 +0000 (05:29 +0000)
committerMark Andrews <marka@isc.org>
Thu, 4 Mar 2010 05:29:15 +0000 (05:29 +0000)
                        recorded. [RT #20927]

CHANGES
lib/isc/mem.c

diff --git a/CHANGES b/CHANGES
index a67cd5202da6008ebaedbaa58a0c1166871c89c2..2dfe4c04c9f112113cd72fb09691e48adb6c20d8 100644 (file)
--- 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]
 
index ef6ece0c293844507674e0bc7dbb0a12edc8c9df..6530892727e0baf4b8013fa7c3afc1794248f111 100644 (file)
@@ -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++;
 }