From f13d97e09c4dff4795b3a6b66bca9bdf29edeaca Mon Sep 17 00:00:00 2001 From: Sang Seok Lim Date: Thu, 10 Feb 2005 16:58:56 +0000 Subject: [PATCH] Fix memory leak in a component encoder --- contrib/slapd-modules/comp_match/init.c | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- 2.39.5