]> git.sur5r.net Git - openldap/commitdiff
Code which doesn't hanlding allocation failure should use
authorKurt Zeilenga <kurt@openldap.org>
Thu, 6 Apr 2006 21:09:59 +0000 (21:09 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 6 Apr 2006 21:09:59 +0000 (21:09 +0000)
ch_ routines, not SLAP_ macros

servers/slapd/back-ldif/ldif.c
servers/slapd/result.c
servers/slapd/value.c

index 568aae2f978d2919ce1e698d113c6eb470dd4cd4..44309c7fcfbbb67d7b17e824e86d13f64bfaac9a 100644 (file)
@@ -356,7 +356,7 @@ static int r_enum_tree(enumCookie *ck, struct berval *path,
                                ck->elen = ENTRY_BUFF_INCREMENT;
                        }
                        if(ck->eind >= ck->elen) { /* grow entries if necessary */      
-                               ck->entries = (Entry **) SLAP_REALLOC(ck->entries, sizeof(Entry *) * (ck->elen) * 2);
+                               ck->entries = (Entry **) ch_realloc(ck->entries, sizeof(Entry *) * (ck->elen) * 2);
                                ck->elen *= 2;
                        }
 
index b50205b9f414c7b62d8c923ea1a5d07d3c0e546c..64c71772278870fcae9286bae55f77f6e03f8d17 100644 (file)
@@ -99,7 +99,7 @@ static char *v2ref( BerVarray ref, const char *text )
        len += sizeof("Referral:");
 
        for( i=0; ref[i].bv_val != NULL; i++ ) {
-               v2 = SLAP_REALLOC( v2, len + ref[i].bv_len + 1 );
+               v2 = ch_realloc( v2, len + ref[i].bv_len + 1 );
                if( v2 == NULL ) {
                        Debug( LDAP_DEBUG_ANY, "v2ref: SLAP_MALLOC failed", 0, 0, 0 );
                        return NULL;
index dbd30cff8f055ed371843ffacbb8dff3d9193990..10f8e00938ffe3507184325c19d1ae4d1ea606dc 100644 (file)
@@ -65,7 +65,7 @@ value_add(
                for ( n = 0; !BER_BVISNULL( &(*vals)[n] ); n++ ) {
                        ;       /* Empty */
                }
-               *vals = (BerVarray) SLAP_REALLOC( (char *) *vals,
+               *vals = (BerVarray) ch_realloc( (char *) *vals,
                    (n + nn + 1) * sizeof(struct berval) );
                if( *vals == NULL ) {
                        Debug(LDAP_DEBUG_TRACE,