]> git.sur5r.net Git - openldap/commitdiff
Fix memory leak in a component encoder
authorSang Seok Lim <slim@openldap.org>
Thu, 10 Feb 2005 16:58:56 +0000 (16:58 +0000)
committerSang Seok Lim <slim@openldap.org>
Thu, 10 Feb 2005 16:58:56 +0000 (16:58 +0000)
contrib/slapd-modules/comp_match/init.c

index 677dee6cfbb6b33d134d9f511e1ec73fb0dfe555..9226262689c70675715d13319d8eac4bc69c9510 100644 (file)
@@ -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;
 }