From: Sang Seok Lim Date: Thu, 10 Feb 2005 16:58:56 +0000 (+0000) Subject: Fix memory leak in a component encoder X-Git-Tag: OPENLDAP_REL_ENG_2_3_BP~183 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f13d97e09c4dff4795b3a6b66bca9bdf29edeaca;p=openldap Fix memory leak in a component encoder --- diff --git a/contrib/slapd-modules/comp_match/init.c b/contrib/slapd-modules/comp_match/init.c index 677dee6cfb..9226262689 100644 --- a/contrib/slapd-modules/comp_match/init.c +++ b/contrib/slapd-modules/comp_match/init.c @@ -760,11 +760,14 @@ comp_component_encoder ( void* mem_op, ComponentSyntaxInfo* csi , struct berval* * use nibble memory in it */ free ( bv.bv_val ); + GenBufFreeBuf( b ); + BufFreeBuf( buf ); return LDAP_SUCCESS; } rc = csi->csi_comp_desc->cd_gser_encoder( b, csi ); if ( rc < 0 ) { + GenBufFreeBuf( b ); BufFreeBuf( buf ); return rc; } @@ -780,6 +783,7 @@ comp_component_encoder ( void* mem_op, ComponentSyntaxInfo* csi , struct berval* BufCopy( nval->bv_val, b, size ); } ExpBufFreeBuf( buf ); + GenBufFreeBuf( b ); return LDAP_SUCCESS; }