From: Howard Chu Date: Thu, 10 Apr 2003 06:14:16 +0000 (+0000) Subject: More malloc context tweaks X-Git-Tag: OPENLDAP_REL_ENG_2_2_0ALPHA~407 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=42e7845d81d6eb1e4ca28742b51ca7b9e4007271;p=openldap More malloc context tweaks --- diff --git a/libraries/liblber/encode.c b/libraries/liblber/encode.c index 8c11027c47..c29f0b1132 100644 --- a/libraries/liblber/encode.c +++ b/libraries/liblber/encode.c @@ -442,7 +442,7 @@ ber_start_seqorset( assert( ber != NULL ); assert( LBER_VALID( ber ) ); - new = (Seqorset *) LBER_CALLOC( 1, sizeof(Seqorset) ); + new = (Seqorset *) ber_memcalloc_x( 1, sizeof(Seqorset), ber->ber_memctx ); if ( new == NULL ) { return -1; @@ -649,7 +649,7 @@ ber_put_seqorset( BerElement *ber ) } /* we're done with this seqorset, so free it up */ - LBER_FREE( (char *) (*sos) ); + ber_memfree_x( (char *) (*sos), ber->ber_memctx ); *sos = next; return taglen + lenlen + len; diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index 439c0c4e7c..064d80e0ee 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -160,11 +160,11 @@ ber_free_buf( BerElement *ber ) assert( LBER_VALID( ber ) ); - if ( ber->ber_buf) LBER_FREE( ber->ber_buf ); + if ( ber->ber_buf) ber_memfree_x( ber->ber_buf, ber->ber_memctx ); for( s = ber->ber_sos ; s != NULL ; s = next ) { next = s->sos_next; - LBER_FREE( s ); + ber_memfree_x( s, ber->ber_memctx ); } ber->ber_buf = NULL; @@ -186,7 +186,7 @@ ber_free( BerElement *ber, int freebuf ) if( freebuf ) ber_free_buf( ber ); - LBER_FREE( (char *) ber ); + ber_memfree_x( (char *) ber, ber->ber_memctx ); } int