int mode, bytesDecoded, size, rc;
         void* component;
        char* oid = a->a_desc->ad_type->sat_atype.at_oid ;
-        GenBuf* b;
-        ExpBuf* buf;
+        GenBuf* b = NULL;
+        ExpBuf* buf = NULL;
        OidDecoderMapping* odm;
        
        /* look for the decoder registered for the given attribute */
        }
 
        ExpBufFreeBuf( buf );
+       GenBufFreeBuf( b );
        if ( rc == -1 ) {
                ShutdownNibbleMemLocal ( a->a_comp_data->cd_mem_op );
                free ( a->a_comp_data );
 
        rc = (*decoder)( mem_op, genBuf, csi, len, mode );
        ExpBufFreeBuf ( buf );
+       GenBufFreeBuf( genBuf );
 }
 
 int intToAscii( int value, char* buf ) {
                        mode = DEC_ALLOC_MODE_2;
 
                        /* Try to decode with BER/DER decoder */
-#if 0
-                       rc =BDecComponentTop( odm->BER_Decode, attr_nm, b, 0,0, &contained_comp,&bytesDecoded, mode );
-#endif
                        rc = odm->BER_Decode ( attr_nm, b, (ComponentSyntaxInfo*)&contained_comp, &bytesDecoded, mode );
 
-#if 0
-                       if ( rc != LDAP_SUCCESS ) {
-                               /* If fails with BER/DER decoder, try with GSER */
-                               bytesDecoded = 0;
-                               BufResetInReadMode( b );
-                               rc = odm->GSER_decoder( attr_nm, b, contained_comp, &bytesDecoded, mode);
-                       }
-#endif
                        ExpBufFreeBuf( buf );
+                       GenBufFreeBuf( b );
 
                        if ( rc != LDAP_SUCCESS ) return LDAP_PROTOCOL_ERROR;