}
}
- tmpctrls = (LDAPControl *)realloc( unknown_ctrls,
+ tmpctrls = (LDAPControl *)ber_memrealloc( unknown_ctrls,
(unknown_ctrls_num + 1)*sizeof( LDAPControl ) );
if ( tmpctrls == NULL ) {
fprintf( stderr, "%s: no memory?\n", prog );
for ( i = 0; hosts[ i ] != NULL; i++ )
/* count'em */ ;
- tmp = (char **)realloc( urls, sizeof( char * ) * ( nurls + i + 1 ) );
+ tmp = (char **)ber_memrealloc( urls, sizeof( char * ) * ( nurls + i + 1 ) );
if ( tmp == NULL ) {
fprintf( stderr,
"DNS SRV: out of memory?\n" );
ber_memfree( domain );
} else {
- tmp = (char **)realloc( urls, sizeof( char * ) * ( nurls + 2 ) );
+ tmp = (char **)ber_memrealloc( urls, sizeof( char * ) * ( nurls + 2 ) );
if ( tmp == NULL ) {
fprintf( stderr,
"DNS SRV: out of memory?\n" );
tool_server_controls( ld, c, i );
- ber_free( seber, 1 );
- ber_free( vrber, 1 );
+ if ( seber ) ber_free( seber, 1 );
+ if ( vrber ) ber_free( vrber, 1 );
/* step back to the original number of controls, so that
* those set while parsing args are preserved */