From: Ted Lemon Date: Sat, 24 Jun 2000 06:27:04 +0000 (+0000) Subject: When debugging malloc on an object, be sure it has no special free routine. X-Git-Tag: V3-BETA-2-PATCH-1~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=524c92851cc332a60d47e31875363dee441215dc;p=thirdparty%2Fdhcp.git When debugging malloc on an object, be sure it has no special free routine. --- diff --git a/omapip/alloc.c b/omapip/alloc.c index 88b114911..11b8ecd3e 100644 --- a/omapip/alloc.c +++ b/omapip/alloc.c @@ -368,8 +368,10 @@ isc_result_t omapi_object_reference (omapi_object_t **r, } *r = h; h -> refcnt++; - rc_register (file, line, r, h, h -> refcnt); - dmalloc_reuse (h, file, line, 1); + if (!h -> type -> freer) { + rc_register (file, line, r, h, h -> refcnt); + dmalloc_reuse (h, file, line, 1); + } return ISC_R_SUCCESS; } @@ -467,14 +469,16 @@ isc_result_t omapi_object_dereference (omapi_object_t **h, if (outer_reference) omapi_object_dereference (&(*h) -> outer -> inner, file, line); - rc_register (file, line, h, *h, 0); + if (!(*h) -> type -> freer) + rc_register (file, line, h, *h, 0); if ((*h) -> type -> destroy) (*((*h) -> type -> destroy)) (*h, file, line); dfree (*h, file, line); } } else { (*h) -> refcnt--; - rc_register (file, line, h, *h, (*h) -> refcnt); + if (!(*h) -> type -> freer) + rc_register (file, line, h, *h, (*h) -> refcnt); } *h = 0; return ISC_R_SUCCESS;