From: Howard Chu Date: Sat, 7 Mar 2009 01:31:34 +0000 (+0000) Subject: mem cleanup (see ITS#6005) not worth chasing them all down X-Git-Tag: ACLCHECK_0~730 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7029d640cbc7717b7c0d511e982002a3c1c313fc;p=openldap mem cleanup (see ITS#6005) not worth chasing them all down --- diff --git a/clients/tools/common.c b/clients/tools/common.c index cb23ef41c2..549a42536f 100644 --- a/clients/tools/common.c +++ b/clients/tools/common.c @@ -647,7 +647,7 @@ tool_args( int argc, char **argv ) } } - 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 ); @@ -1193,7 +1193,7 @@ tool_conn_setup( int dont, void (*private_setup)( LDAP * ) ) 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" ); @@ -1227,7 +1227,7 @@ dnssrv_free:; 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" ); diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index 5d34c63159..e10c9b3357 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -1034,8 +1034,8 @@ getNextPage: 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 */