mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-26 01:29:59 -05:00
fix one-time leaks
This commit is contained in:
parent
946e859108
commit
9ab9162f4d
2 changed files with 20 additions and 1 deletions
|
|
@ -223,6 +223,17 @@ tool_destroy( void )
|
|||
#ifdef HAVE_TLS
|
||||
ldap_pvt_tls_destroy();
|
||||
#endif
|
||||
|
||||
if ( ldapuri != NULL ) {
|
||||
ber_memfree( ldapuri );
|
||||
ldapuri = NULL;
|
||||
}
|
||||
|
||||
if ( pr_cookie.bv_val != NULL ) {
|
||||
ber_memfree( pr_cookie.bv_val );
|
||||
pr_cookie.bv_val = NULL;
|
||||
pr_cookie.bv_len = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -95,6 +95,8 @@ static int attrsonly;
|
|||
static int timelimit = -1;
|
||||
static int sizelimit = -1;
|
||||
|
||||
static char *control;
|
||||
|
||||
static char *def_tmpdir;
|
||||
static char *def_urlpre;
|
||||
|
||||
|
|
@ -255,7 +257,7 @@ int
|
|||
handle_private_option( int i )
|
||||
{
|
||||
int crit, ival;
|
||||
char *control, *cvalue, *next;
|
||||
char *cvalue, *next;
|
||||
switch ( i ) {
|
||||
case 'a': /* set alias deref option */
|
||||
if ( strcasecmp( optarg, "never" ) == 0 ) {
|
||||
|
|
@ -1040,6 +1042,12 @@ getNextPage:
|
|||
|
||||
tool_unbind( ld );
|
||||
tool_destroy();
|
||||
if ( base != NULL ) {
|
||||
ber_memfree( base );
|
||||
}
|
||||
if ( control != NULL ) {
|
||||
ber_memfree( control );
|
||||
}
|
||||
|
||||
if ( c ) {
|
||||
for ( ; save_nctrls-- > 0; ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue