]> git.sur5r.net Git - openldap/commitdiff
Cleanup
authorHoward Chu <hyc@openldap.org>
Fri, 31 Mar 2006 10:45:23 +0000 (10:45 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 31 Mar 2006 10:45:23 +0000 (10:45 +0000)
servers/slapd/back-monitor/init.c
servers/slapd/component.c
servers/slapd/overlays/syncprov.c
servers/slapd/sl_malloc.c
servers/slapd/value.c

index 5e3c1db925b29b0a82517cea43250058972e0715..249b3641635e7d9d35678127802bf17aa59e07d0 100644 (file)
@@ -860,7 +860,7 @@ monitor_back_register_entry_attrs(
 
 done:;
                if ( rc ) {
-                       if ( *atp ) {
+                       if ( atp && *atp ) {
                                attrs_free( *atp );
                                *atp = NULL;
                        }
index 3fe99d1dfd4dca4fc2da984d3bd316a9bee843b4..0b6cb2d51979ee6006437ac1ce26f16706dc11f7 100644 (file)
@@ -594,16 +594,8 @@ get_component_reference(
                return rc;
        }
 
-       if ( rc == LDAP_SUCCESS ) {     
-               *cr = ca_comp_ref;
-               **cr = *ca_comp_ref;    
-
-       } else if ( op ) {
-                op->o_tmpfree( ca_comp_ref , op->o_tmpmemctx );
-
-       } else {
-                free( ca_comp_ref ) ;
-       }
+       *cr = ca_comp_ref;
+       **cr = *ca_comp_ref;    
 
        (*cr)->cr_string.bv_val = start;
        (*cr)->cr_string.bv_len = end - start + 1;
index f697131834b6acc0ed829b27deb6f2742e09b1ac..916b2a2ae31167a8aa3ad18b43a88a4b9502e2f5 100644 (file)
@@ -1302,9 +1302,6 @@ syncprov_add_slog( Operation *op, struct berval *csn )
                        sl->sl_mincsn.bv_len = se->se_csn.bv_len;
                        ch_free( se );
                        sl->sl_num--;
-                       if ( !sl->sl_head ) {
-                               sl->sl_tail = NULL;
-                       }
                }
                ldap_pvt_thread_mutex_unlock( &sl->sl_mutex );
        }
index 17c9207c8f200e092530c7140edc324214595d48..32b45bc271fbeeb5d581b19ed8d8696c74cbe6de 100644 (file)
@@ -422,6 +422,9 @@ slap_sl_free(void *ptr, void *ctx)
        unsigned long diff;
        int i, inserted = 0;
 
+       if (!ptr)
+               return;
+
        if (!sh || ptr < sh->sh_base || ptr >= sh->sh_end) {
                ber_memfree_x(ptr, NULL);
        } else if (sh->sh_stack && (char *)ptr + p[-1] == sh->sh_last) {
index dbd30cff8f055ed371843ffacbb8dff3d9193990..4afb5e640150282d2049aa290750bda2b41db758 100644 (file)
@@ -75,7 +75,7 @@ value_add(
        }
 
        v2 = &(*vals)[n];
-       for ( ; !BER_BVISNULL( addvals ); v2++, addvals++ ) {
+       for ( n = 0 ; n < nn; v2++, addvals++ ) {
                ber_dupbv( v2, addvals );
                if ( BER_BVISNULL( v2 ) ) break;
        }
@@ -718,6 +718,8 @@ ordered_value_add(
                                next[ 0 ] != '}' ||
                                next - vals[i].bv_val > vals[i].bv_len )
                        {
+                               ch_free( nnew );
+                               ch_free( new );
                                return -1;
                        }
                        if ( k > anum ) k = -1;