summaryrefslogtreecommitdiff
path: root/omapip/alloc.c
diff options
context:
space:
mode:
authorDavid Hankins <dhankins@isc.org>2009-04-07 19:55:52 +0000
committerDavid Hankins <dhankins@isc.org>2009-04-07 19:55:52 +0000
commit95fd7038a23f12f24ab375909cf9a1867e5c34b5 (patch)
treedacb1b9c05f619e89c0153603e50bfc8e460f25c /omapip/alloc.c
parente6b3a140463ae2da8c891f1cbd86820f78da0c92 (diff)
downloadisc-dhcp-95fd7038a23f12f24ab375909cf9a1867e5c34b5.tar.gz
- Memory leak in the load_balance_mine() function is fixed. This would
leak ~20-30 octets per DHCPDISCOVER packet while failover was in use and in normal state. [ISC-Bugs #19548] - Various compilation fixes have been included for the memory related DEBUG #defines in includes/site.h. [ISC-Bugs #19548]
Diffstat (limited to 'omapip/alloc.c')
-rw-r--r--omapip/alloc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/omapip/alloc.c b/omapip/alloc.c
index 4572633c..3a79d90a 100644
--- a/omapip/alloc.c
+++ b/omapip/alloc.c
@@ -255,8 +255,9 @@ void dmalloc_dump_outstanding ()
{
static unsigned long dmalloc_cutoff_point;
struct dmalloc_preamble *dp;
+#if defined(DEBUG_MALLOC_POOL)
unsigned char *foo;
- int i;
+#endif
if (!dmalloc_cutoff_point)
dmalloc_cutoff_point = dmalloc_cutoff_generation;
@@ -307,7 +308,7 @@ void dmalloc_dump_outstanding ()
if (rc_history [i].addr == dp + 1) {
inhistory = 1;
if (!noted) {
- log_info (" %s(%d): %d", dp -> file,
+ log_info (" %s(%d): %ld", dp -> file,
dp -> line, dp -> size);
noted = 1;
}
@@ -320,7 +321,7 @@ void dmalloc_dump_outstanding ()
} while (count--);
if (!inhistory)
#endif
- log_info (" %s(%d): %d",
+ log_info (" %s(%d): %ld",
dp -> file, dp -> line, dp -> size);
}
#endif
@@ -353,7 +354,7 @@ void dump_rc_history (void *addr)
i += RC_HISTORY_MAX;
}
rc_history_count = 0;
-
+
while (rc_history [i].file) {
if (!addr || addr == rc_history [i].addr)
print_rc_hist_entry (i);
@@ -427,7 +428,6 @@ static int dmalloc_find_entry (struct dmalloc_preamble *dp,
int min, int max)
{
int middle;
- int cmp;
middle = (min + max) / 2;
if (middle == min)
@@ -448,8 +448,7 @@ static int dmalloc_find_entry (struct dmalloc_preamble *dp,
void omapi_print_dmalloc_usage_by_caller ()
{
struct dmalloc_preamble *dp;
- unsigned char *foo;
- int ccur, cmax, i, j;
+ int ccur, cmax, i;
struct caller cp [1024];
cmax = 1024;
@@ -494,7 +493,9 @@ void omapi_print_dmalloc_usage_by_caller ()
for (i = 0; i < ccur; i++) {
printf ("%d\t%s:%d\t%d\n", i,
cp [i].dp -> file, cp [i].dp -> line, cp [i].count);
+#if defined(DUMP_RC_HISTORY)
dump_rc_history (cp [i].dp + 1);
+#endif
}
}
#endif /* DEBUG_MEMORY_LEAKAGE || DEBUG_MALLOC_POOL */