]> git.sur5r.net Git - openldap/commitdiff
Cleanup
authorHoward Chu <hyc@openldap.org>
Thu, 6 Oct 2005 19:11:13 +0000 (19:11 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 6 Oct 2005 19:11:13 +0000 (19:11 +0000)
servers/slapd/ad.c
servers/slapd/ldapsync.c
servers/slapd/syncrepl.c

index 48b4b272194f6f6bd5f29bf092d229472b96651d..d351c5c49dcf6743d1543754e51b5f99aaa4eac6 100644 (file)
@@ -1029,9 +1029,8 @@ anlist2attrs( AttributeName * anlist )
        i = 0;
        while ( attrs && attrs[i] ) {
                if ( *attrs[i] == '@' ) {
+                       ch_free( attrs[i] );
                        for ( j = i; attrs[j]; j++ ) {
-                               if ( j == i )
-                                       ch_free( attrs[i] );
                                attrs[j] = attrs[j+1];
                        }
                } else {
@@ -1043,9 +1042,8 @@ anlist2attrs( AttributeName * anlist )
                j = i + 1;
                while ( attrs && attrs[j] ) {
                        if ( !strcmp( attrs[i], attrs[j] )) {
+                               ch_free( attrs[j] );
                                for ( k = j; attrs && attrs[k]; k++ ) {
-                                       if ( k == j )
-                                               ch_free( attrs[j] );
                                        attrs[k] = attrs[k+1];
                                }
                        } else {
index 9d335860dfbb9c8057d27fc211f02f7bc7a1fd82..72022c24fa1c8612f34887caf5f47804ccf11577 100644 (file)
@@ -55,7 +55,8 @@ slap_compose_sync_cookie(
                                        "csn=%s,rid=%03d", csn->bv_val, rid );
                }
        }
-       ber_str2bv( cookiestr, strlen(cookiestr), 1, cookie );
+       ber_str2bv_x( cookiestr, strlen(cookiestr), 1, cookie, 
+               op ? op->o_tmpmemctx : NULL );
 }
 
 void
index 2a4220be9a8c1a0b2943b5b40670a542267c2c6d..f812d5d4aaf67a712da7565a34c4b7c704c5324a 100644 (file)
@@ -231,9 +231,8 @@ init_syncrepl(syncinfo_t *si)
                        j = 0;
                        while ( exattrs[j] != NULL ) {
                                if ( !strcmp( exattrs[j], sync_descs[i]->ad_cname.bv_val )) {
+                                       ch_free( exattrs[j] );
                                        for ( k = j; exattrs[k] != NULL; k++ ) {
-                                               if ( k == j )
-                                                       ch_free( exattrs[k] );
                                                exattrs[k] = exattrs[k+1];
                                        }
                                } else {
@@ -250,9 +249,8 @@ init_syncrepl(syncinfo_t *si)
                                        while ( oc->soc_required[k] ) {
                                                if ( !strcmp( exattrs[i],
                                                         oc->soc_required[k]->sat_cname.bv_val )) {
+                                                       ch_free( exattrs[i] );
                                                        for ( l = i; exattrs[l]; l++ ) {
-                                                               if ( l == i )
-                                                                       ch_free( exattrs[i] );
                                                                exattrs[l] = exattrs[l+1];
                                                        }
                                                } else {