]> git.sur5r.net Git - openldap/commitdiff
Use 'm' ber_scanf format where convenient
authorHoward Chu <hyc@openldap.org>
Sun, 6 Jan 2002 06:11:01 +0000 (06:11 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 6 Jan 2002 06:11:01 +0000 (06:11 +0000)
16 files changed:
servers/slapd/add.c
servers/slapd/ava.c
servers/slapd/back-bdb/passwd.c
servers/slapd/back-ldap/search.c
servers/slapd/back-ldbm/passwd.c
servers/slapd/back-meta/search.c
servers/slapd/bind.c
servers/slapd/compare.c
servers/slapd/delete.c
servers/slapd/filter.c
servers/slapd/modify.c
servers/slapd/modrdn.c
servers/slapd/mods.c
servers/slapd/mra.c
servers/slapd/passwd.c
servers/slapd/search.c

index e1ad469d70ed474017cd9a9489f44c678eec5af8..e167eb5b1ae18edccd36b43a9b5ed57370131cf6 100644 (file)
@@ -66,7 +66,7 @@ do_add( Connection *conn, Operation *op )
         */
 
        /* get the name */
-       if ( ber_scanf( ber, "{o", /*}*/ &dn ) == LBER_ERROR ) {
+       if ( ber_scanf( ber, "{m", /*}*/ &dn ) == LBER_ERROR ) {
 #ifdef NEW_LOGGING
                LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
                        "do_add: conn %d ber_scanf failed\n", conn->c_connid ));
@@ -114,7 +114,7 @@ do_add( Connection *conn, Operation *op )
        {
                Modifications *mod;
 
-               rc = ber_scanf( ber, "{o{W}}", &tmp.sml_type, &tmp.sml_bvalues );
+               rc = ber_scanf( ber, "{m{W}}", &tmp.sml_type, &tmp.sml_bvalues );
 
                if ( rc == LBER_ERROR ) {
 #ifdef NEW_LOGGING
@@ -324,8 +324,6 @@ do_add( Connection *conn, Operation *op )
        }
 
 done:
-       free( dn.bv_val );
-
        if( modlist != NULL ) {
                slap_mods_free( modlist );
        }
index 0d96d8bc59248de059df5085582f09b04f3c373a..c9c2c1fee9bf9e95a9e22daf1a09dbe8f96f1c0c 100644 (file)
@@ -39,7 +39,7 @@ get_ava(
        struct berval type, value;
        AttributeAssertion *aa;
 
-       rc = ber_scanf( ber, "{oo}", &type, &value );
+       rc = ber_scanf( ber, "{mm}", &type, &value );
 
        if( rc == LBER_ERROR ) {
 #ifdef NEW_LOGGING
@@ -57,16 +57,13 @@ get_ava(
        aa->aa_value.bv_val = NULL;
 
        rc = slap_bv2ad( &type, &aa->aa_desc, text );
-       ch_free( type.bv_val );
 
        if( rc != LDAP_SUCCESS ) {
-               ch_free( value.bv_val );
                ch_free( aa );
                return rc;
        }
 
        rc = value_normalize( aa->aa_desc, usage, &value, &aa->aa_value, text );
-       ch_free( value.bv_val );
 
        if( rc != LDAP_SUCCESS ) {
                ch_free( aa );
index c39649bfea15cdecff6553722f93bc35ab4d5c6e..df9223d4d2577778f3e776ae960b5666efb629be 100644 (file)
@@ -214,14 +214,6 @@ done:
                bdb_entry_return( be, e );
        }
 
-       if( id.bv_val != NULL ) {
-               free( id.bv_val );
-       }
-
-       if( new.bv_val != NULL ) {
-               free( new.bv_val );
-       }
-
        if( hash.bv_val != NULL ) {
                free( hash.bv_val );
        }
index def4edbbde7a7ee37f223bd4ff1e5d6b2ee79548..69cb44963681ea045797dc6e8d56b3ca2dda5d9d 100644 (file)
@@ -379,7 +379,7 @@ ldap_send_entry(
        struct berval *bv, bdn;
        const char *text;
 
-       if ( ber_scanf( &ber, "{o{", &bdn ) == LBER_ERROR ) {
+       if ( ber_scanf( &ber, "{m{", &bdn ) == LBER_ERROR ) {
                return;
        }
 #ifdef ENABLE_REWRITE
@@ -392,7 +392,6 @@ ldap_send_entry(
        case REWRITE_REGEXEC_OK:
                if ( ent.e_name.bv_val == NULL ) {
                        ent.e_name = bdn;
-                       
                } else {
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
@@ -402,8 +401,6 @@ ldap_send_entry(
                        Debug( LDAP_DEBUG_ARGS, "rw> searchResult: \"%s\""
                                        " -> \"%s\"\n%s", bdn.bv_val, ent.e_dn, "" );
 #endif /* !NEW_LOGGING */
-                       free( bdn.bv_val );
-                       bdn.bv_val = NULL;
                        ent.e_name.bv_len = strlen( ent.e_name.bv_val );
                }
                break;
@@ -422,11 +419,8 @@ ldap_send_entry(
        ent.e_private = 0;
        attrp = &ent.e_attrs;
 
-       while ( ber_scanf( &ber, "{o", &a ) != LBER_ERROR ) {
+       while ( ber_scanf( &ber, "{m", &a ) != LBER_ERROR ) {
                ldap_back_map(&li->at_map, &a, &mapped, 1);
-               if ( mapped.bv_val != a.bv_val) {
-                       free( a.bv_val );
-               }
                if (mapped.bv_val == NULL)
                        continue;
                attr = (Attribute *)ch_malloc( sizeof(Attribute) );
@@ -474,7 +468,7 @@ ldap_send_entry(
                                        attr->a_vals[last].bv_val = NULL;
                                        i--;
                                } else if ( mapped.bv_val != bv->bv_val ) {
-                                       ch_free(bv->bv_val);
+                                       free(bv->bv_val);
                                        ber_dupbv( bv, &mapped );
                                }
                        }
@@ -520,7 +514,6 @@ ldap_send_entry(
                                                attr->a_desc->ad_type->sat_cname.bv_val,
                                                bv->bv_val, newval );
 #endif /* !NEW_LOGGING */
-                                       
                                        free( bv->bv_val );
                                        bv->bv_val = newval;
                                        bv->bv_len = strlen( newval );
@@ -553,9 +546,8 @@ ldap_send_entry(
                free(attr);
        }
        
-       if ( ent.e_dn )
+       if ( ent.e_dn && ent.e_dn != bdn.bv_val )
                free( ent.e_dn );
        if ( ent.e_ndn )
                free( ent.e_ndn );
 }
-
index 0b8dac84a0a9350b2ccf9ca9c990e759b65f51d9..7304ae88748467561587c4aaad7b33459371e4bf 100644 (file)
@@ -175,14 +175,6 @@ done:
                cache_return_entry_w( &li->li_cache, e );
        }
 
-       if( id.bv_val != NULL ) {
-               free( id.bv_val );
-       }
-
-       if( new.bv_val != NULL ) {
-               free( new.bv_val );
-       }
-
        if( hash.bv_val != NULL ) {
                free( hash.bv_val );
        }
index 0cab9aec9374849a4a93912a4ce10ffb6a30c38e..e47554875751c2767fad7ada2b657aa0cf25442f 100644 (file)
@@ -588,7 +588,7 @@ meta_send_entry(
        struct berval           *bv, bdn;
        const char              *text;
 
-       if ( ber_scanf( &ber, "{o{", &bdn ) == LBER_ERROR ) {
+       if ( ber_scanf( &ber, "{m{", &bdn ) == LBER_ERROR ) {
                return;
        }
 
@@ -611,8 +611,6 @@ meta_send_entry(
                        Debug( LDAP_DEBUG_ARGS, "rw> searchResult[%d]: \"%s\""
                                        " -> \"%s\"\n", target, bdn.bv_val, ent.e_name.bv_val );
 #endif /* !NEW_LOGGING */
-                       free( bdn.bv_val );
-                       bdn.bv_val = NULL;
                        ent.e_name.bv_len = strlen( ent.e_name.bv_val );
                }
                break;
@@ -638,12 +636,9 @@ meta_send_entry(
        ent.e_private = 0;
        attrp = &ent.e_attrs;
 
-       while ( ber_scanf( &ber, "{o", &a ) != LBER_ERROR ) {
+       while ( ber_scanf( &ber, "{m", &a ) != LBER_ERROR ) {
                ldap_back_map( &li->targets[ target ]->at_map, 
                                &a, &mapped, 1 );
-               if ( mapped.bv_val != a.bv_val ) {
-                       free( a.bv_val );
-               }
                if ( mapped.bv_val == NULL ) {
                        continue;
                }
@@ -697,7 +692,7 @@ meta_send_entry(
                                        i--;
 
                                } else if ( mapped.bv_val != bv->bv_val ) {
-                                       ch_free( bv->bv_val );
+                                       free( bv->bv_val );
                                        ber_dupbv( bv, &mapped );
                                }
                        }
@@ -742,7 +737,6 @@ meta_send_entry(
                                        attr->a_desc->ad_type->sat_cname.bv_val,
                                                bv->bv_val, newval );
 #endif /* !NEW_LOGGING */
-                                       
                                        free( bv->bv_val );
                                        bv->bv_val = newval;
                                        bv->bv_len = strlen( newval );
@@ -774,7 +768,7 @@ meta_send_entry(
                free( attr );
        }
        
-       if ( ent.e_dn ) {
+       if ( ent.e_dn && ent.e_dn != bdn.bv_val ) {
                free( ent.e_dn );
        }
        if ( ent.e_ndn ) {
index ac42ed06deb699ef856f6fb7d5173ae5c4cca6c0..072f812abd42ec2b1af6d990f91164a82048a774 100644 (file)
@@ -92,7 +92,7 @@ do_bind(
         *      }
         */
 
-       tag = ber_scanf( ber, "{iot" /*}*/, &version, &dn, &method );
+       tag = ber_scanf( ber, "{imt" /*}*/, &version, &dn, &method );
 
        if ( tag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
@@ -110,7 +110,7 @@ do_bind(
        op->o_protocol = version;
 
        if( method != LDAP_AUTH_SASL ) {
-               tag = ber_scanf( ber, /*{*/ "o}", &cred );
+               tag = ber_scanf( ber, /*{*/ "m}", &cred );
 
        } else {
                tag = ber_scanf( ber, "{a" /*}*/, &mech );
@@ -120,7 +120,7 @@ do_bind(
                        tag = ber_peek_tag( ber, &len );
 
                        if ( tag == LDAP_TAG_LDAPCRED ) { 
-                               tag = ber_scanf( ber, "o", &cred );
+                               tag = ber_scanf( ber, "m", &cred );
                        } else {
                                tag = LDAP_TAG_LDAPCRED;
                                cred.bv_val = NULL;
@@ -249,7 +249,7 @@ do_bind(
                        goto cleanup;
                }
 
-               if( mech == NULL || *mech == '\0' ) {
+               if( mech == NULL || mech[0] == '\0' ) {
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
                                   "do_bind: conn %d  no SASL mechanism provided\n",
@@ -536,7 +536,6 @@ do_bind(
        }
 
 cleanup:
-       free( dn.bv_val );
        if( pdn.bv_val != NULL ) {
                free( pdn.bv_val );
        }
@@ -546,9 +545,6 @@ cleanup:
        if ( mech != NULL ) {
                free( mech );
        }
-       if ( cred.bv_val != NULL ) {
-               free( cred.bv_val );
-       }
 
        return rc;
 }
index 001b0447ca746bc58b1c488b157ae224c86cbe7b..f1e88345d69c221de618ab777ebe5949b60cd650 100644 (file)
@@ -41,7 +41,7 @@ do_compare(
        struct berval ndn = { 0, NULL };
        struct berval desc = { 0, NULL };
        struct berval value = { 0, NULL };
-       AttributeAssertion ava;
+       AttributeAssertion ava = { 0 };
        Backend *be;
        int rc = LDAP_SUCCESS;
        const char *text = NULL;
@@ -67,7 +67,7 @@ do_compare(
         *      }
         */
 
-       if ( ber_scanf( op->o_ber, "{o" /*}*/, &dn ) == LBER_ERROR ) {
+       if ( ber_scanf( op->o_ber, "{m" /*}*/, &dn ) == LBER_ERROR ) {
 #ifdef NEW_LOGGING
                LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
                        "do_compare: conn %d  ber_scanf failed\n", conn->c_connid ));
@@ -79,7 +79,7 @@ do_compare(
                return SLAPD_DISCONNECT;
        }
 
-       if ( ber_scanf( op->o_ber, "{oo}", &desc, &value ) == LBER_ERROR ) {
+       if ( ber_scanf( op->o_ber, "{mm}", &desc, &value ) == LBER_ERROR ) {
 #ifdef NEW_LOGGING
                LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
                        "do_compare: conn %d  get ava failed\n", conn->c_connid ));
@@ -274,11 +274,9 @@ do_compare(
        }
 
 cleanup:
-       free( dn.bv_val );
        free( pdn.bv_val );
        free( ndn.bv_val );
-       free( desc.bv_val );
-       free( value.bv_val );
+       if ( ava.aa_value.bv_val ) free( ava.aa_value.bv_val );
 
        return rc;
 }
index 610ed0e786b725b01ab6a14b869c056fa18424fd..362f1b915a3fe5f1dd343a15dbed6f07675c452a 100644 (file)
@@ -52,7 +52,7 @@ do_delete(
         *      DelRequest := DistinguishedName
         */
 
-       if ( ber_scanf( op->o_ber, "o", &dn ) == LBER_ERROR ) {
+       if ( ber_scanf( op->o_ber, "m", &dn ) == LBER_ERROR ) {
 #ifdef NEW_LOGGING
                LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
                        "do_delete: conn: %d  ber_scanf failed\n", conn->c_connid ));
@@ -197,7 +197,6 @@ do_delete(
        }
 
 cleanup:
-       free( dn.bv_val );
        free( pdn.bv_val );
        free( ndn.bv_val );
        return rc;
index 2b4544cbc0f41d4f77860c68c7783a8f5a797d64..b31be2c09a264749fb976484a5869dda8837637d 100644 (file)
@@ -204,7 +204,7 @@ get_filter(
 #else
                Debug( LDAP_DEBUG_FILTER, "PRESENT\n", 0, 0, 0 );
 #endif
-               if ( ber_scanf( ber, "o", &type ) == LBER_ERROR ) {
+               if ( ber_scanf( ber, "m", &type ) == LBER_ERROR ) {
                        err = SLAPD_DISCONNECT;
                        *text = "error decoding filter";
                        break;
@@ -219,13 +219,10 @@ get_filter(
                        f->f_result = LDAP_COMPARE_FALSE;
                        ber_str2bv("(unrecognized=*)",
                                sizeof("(unrecognized=*)")-1, 1, fstr);
-                       ch_free( type.bv_val );
                        err = LDAP_SUCCESS;
                        break;
                }
 
-               ch_free( type.bv_val );
-
                fstr->bv_len = sizeof("(=*)") - 1 
                        + f->f_desc->ad_cname.bv_len;
                fstr->bv_val = ch_malloc( fstr->bv_len + 1);
@@ -467,7 +464,7 @@ get_substring_filter(
 #else
        Debug( LDAP_DEBUG_FILTER, "begin get_substring_filter\n", 0, 0, 0 );
 #endif
-       if ( ber_scanf( ber, "{o" /*}*/, &bv ) == LBER_ERROR ) {
+       if ( ber_scanf( ber, "{m" /*}*/, &bv ) == LBER_ERROR ) {
                return SLAPD_DISCONNECT;
        }
 
@@ -475,8 +472,6 @@ get_substring_filter(
        f->f_sub_desc = NULL;
        rc = slap_bv2ad( &bv, &f->f_sub_desc, text );
 
-       ch_free( bv.bv_val );
-
        if( rc != LDAP_SUCCESS ) {
                text = NULL;
                ch_free( f->f_sub );
@@ -500,7 +495,7 @@ get_substring_filter(
        {
                unsigned usage;
 
-               rc = ber_scanf( ber, "o", &value );
+               rc = ber_scanf( ber, "m", &value );
                if ( rc == LBER_ERROR ) {
                        rc = SLAPD_DISCONNECT;
                        goto return_error;
@@ -536,12 +531,10 @@ get_substring_filter(
                                "  unknown substring choice=%ld\n",
                                (long) tag, 0, 0 );
 #endif
-                       free( value.bv_val );
                        goto return_error;
                }
 
                rc = value_normalize( f->f_sub_desc, usage, &value, &bv, text );
-               free( value.bv_val );
 
                if( rc != LDAP_SUCCESS ) {
                        goto return_error;
index b46a19aaf646a62cdce79ced6da266625353b8fa..3262b5337aa7c7996aacc583d390fe8987452914 100644 (file)
@@ -75,7 +75,7 @@ do_modify(
         *      }
         */
 
-       if ( ber_scanf( op->o_ber, "{o" /*}*/, &dn ) == LBER_ERROR ) {
+       if ( ber_scanf( op->o_ber, "{m" /*}*/, &dn ) == LBER_ERROR ) {
 #ifdef NEW_LOGGING
                LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
                        "do_modify: ber_scanf failed\n" ));
@@ -106,7 +106,7 @@ do_modify(
                Modifications tmp, *mod;
 
 
-               if ( ber_scanf( op->o_ber, "{i{o[W]}}", &mop,
+               if ( ber_scanf( op->o_ber, "{i{m[W]}}", &mop,
                    &tmp.sml_type, &tmp.sml_bvalues )
                    == LBER_ERROR )
                {
@@ -395,7 +395,6 @@ do_modify(
        }
 
 cleanup:
-       free( dn.bv_val );
        free( pdn.bv_val );
        free( ndn.bv_val );
        if ( modlist != NULL )
index ba85f247dd23bb960beadbb4813c4a5dad140764..60889b7a543cbe6a4b70f9363233a9e7925c42e5 100644 (file)
@@ -83,7 +83,7 @@ do_modrdn(
         *      }
         */
 
-       if ( ber_scanf( op->o_ber, "{oob", &dn, &newrdn, &deloldrdn )
+       if ( ber_scanf( op->o_ber, "{mmb", &dn, &newrdn, &deloldrdn )
            == LBER_ERROR )
        {
 #ifdef NEW_LOGGING
@@ -120,14 +120,14 @@ do_modrdn(
                        goto cleanup;
                }
 
-               if ( ber_scanf( op->o_ber, "o", &newSuperior ) 
+               if ( ber_scanf( op->o_ber, "m", &newSuperior ) 
                     == LBER_ERROR ) {
 
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                               "do_modrdn: ber_scanf(\"a\") failed\n" ));
+                               "do_modrdn: ber_scanf(\"m\") failed\n" ));
 #else
-                       Debug( LDAP_DEBUG_ANY, "ber_scanf(\"a\") failed\n",
+                       Debug( LDAP_DEBUG_ANY, "ber_scanf(\"m\") failed\n",
                                0, 0, 0 );
 #endif
 
@@ -375,15 +375,12 @@ do_modrdn(
        }
 
 cleanup:
-       free( dn.bv_val );
        free( pdn.bv_val );
        free( ndn.bv_val );
 
-       free( newrdn.bv_val );  
        free( pnewrdn.bv_val ); 
        free( nnewrdn.bv_val ); 
 
-       if ( newSuperior.bv_val ) free( newSuperior.bv_val );
        if ( pnewSuperior.bv_val ) free( pnewSuperior.bv_val );
        if ( nnewSuperior.bv_val ) free( nnewSuperior.bv_val );
 
index 3f7772fdfe626ffab9eb59ed4fa60075b19e6197..b2d9566c839236fe7b5bedd9696f331f3ed7bf44 100644 (file)
@@ -24,8 +24,10 @@ slap_mod_free(
        int                             freeit
 )
 {
+#if 0
        if ( mod->sm_type.bv_val)
                free( mod->sm_type.bv_val );
+#endif
        if ( mod->sm_bvalues != NULL )
                bvarray_free( mod->sm_bvalues );
 
index 1c650bc7ac1949ba7673ba092befbdf1d617e45b..98bf139ddb26c2f06396efbe7a33c3b02f6d1800 100644 (file)
@@ -96,7 +96,7 @@ get_mra(
        }
 
        if ( tag == LDAP_FILTER_EXT_TYPE ) {
-               rc = ber_scanf( ber, "o", &type );
+               rc = ber_scanf( ber, "m", &type );
                if ( rc == LBER_ERROR ) {
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
@@ -110,7 +110,6 @@ get_mra(
                }
 
                rc = slap_bv2ad( &type, &ma->ma_desc, text );
-               ch_free( type.bv_val );
 
                if( rc != LDAP_SUCCESS ) {
                        mra_free( ma, 1 );
@@ -146,7 +145,7 @@ get_mra(
                return SLAPD_DISCONNECT;
        }
 
-       rc = ber_scanf( ber, "o", &value );
+       rc = ber_scanf( ber, "m", &value );
 
        if( rc == LBER_ERROR ) {
 #ifdef NEW_LOGGING
@@ -166,7 +165,6 @@ get_mra(
         * normalize for the matching rule.
         */
        rc = value_normalize( ma->ma_desc, SLAP_MR_EQUALITY, &value, &ma->ma_value, text );
-       ch_free( value.bv_val );
 
        if( rc != LDAP_SUCCESS ) {
                mra_free( ma, 1 );
index e9f44db6a0b1ab014e91628f61c694ecdb943d79..0c898771ec4b4c2a9defe96c4f18789c092bd23c 100644 (file)
@@ -116,7 +116,7 @@ int slap_passwd_parse( struct berval *reqdata,
                        goto done;
                }
 
-               tag = ber_scanf( ber, "o", id );
+               tag = ber_scanf( ber, "m", id );
 
                if( tag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
@@ -148,7 +148,7 @@ int slap_passwd_parse( struct berval *reqdata,
                        goto done;
                }
 
-               tag = ber_scanf( ber, "o", oldpass );
+               tag = ber_scanf( ber, "m", oldpass );
 
                if( tag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
@@ -180,7 +180,7 @@ int slap_passwd_parse( struct berval *reqdata,
                        goto done;
                }
 
-               tag = ber_scanf( ber, "o", newpass );
+               tag = ber_scanf( ber, "m", newpass );
 
                if( tag == LBER_ERROR ) {
 #ifdef NEW_LOGGING
index c3ce4bd9c97d0b2fa85c14db10676c4ede9b7fdd..75795eaabf8c8677e2dff0fd631c37459ba03a0c 100644 (file)
@@ -76,7 +76,7 @@ do_search(
         */
 
        /* baseObject, scope, derefAliases, sizelimit, timelimit, attrsOnly */
-       if ( ber_scanf( op->o_ber, "{oiiiib" /*}*/,
+       if ( ber_scanf( op->o_ber, "{miiiib" /*}*/,
                &base, &scope, &deref, &sizelimit,
            &timelimit, &attrsonly ) == LBER_ERROR )
        {
@@ -159,7 +159,7 @@ do_search(
        /* attributes */
        siz = sizeof(AttributeName);
        off = 0;
-       if ( ber_scanf( op->o_ber, "{w}}", &an, &siz, off ) == LBER_ERROR ) {
+       if ( ber_scanf( op->o_ber, "{M}}", &an, &siz, off ) == LBER_ERROR ) {
                send_ldap_disconnect( conn, op,
                        LDAP_PROTOCOL_ERROR, "decoding attrs error" );
                rc = SLAPD_DISCONNECT;
@@ -324,15 +324,11 @@ do_search(
        }
 
 return_results:;
-       free( base.bv_val );
        if( pbase.bv_val != NULL) free( pbase.bv_val );
        if( nbase.bv_val != NULL) free( nbase.bv_val );
 
        if( fstr.bv_val != NULL) free( fstr.bv_val );
        if( filter != NULL) filter_free( filter );
-       for (i = 0; i<siz; i++ ) {
-               free(an[i].an_name.bv_val);
-       }
        free(an);
 
        return rc;