Do not leak lds in slapd-* tools

This commit is contained in:
Ondřej Kuzník 2019-03-27 10:26:44 +00:00 committed by Ondřej Kuzník
parent 5b55054544
commit 593512bb7b
4 changed files with 11 additions and 3 deletions

View file

@ -469,6 +469,9 @@ novals:;
if ( ndns == 0 ) {
tester_error( "No DNs" );
if ( ld != NULL ) {
ldap_unbind_ext( ld, NULL, NULL );
}
return 1;
}

View file

@ -518,6 +518,7 @@ retry:;
if ( rc != LDAP_OPT_SUCCESS ) {
tester_ldap_error( ld, "ldap_set_option(SECPROPS)", NULL );
ldap_unbind_ext( ld, NULL, NULL );
exit( EXIT_FAILURE );
}
}
@ -552,7 +553,7 @@ retry:;
goto retry;
}
}
tester_ldap_error( ld, "ldap_sasl_bind_s", NULL );
ldap_unbind_ext( ld, NULL, NULL );
exit( EXIT_FAILURE );
}
}

View file

@ -150,7 +150,9 @@ do_modify( struct tester_conn_args *config,
mods[1] = NULL;
retry:;
tester_init_ld( &ld, config, 0 );
if ( ld == NULL ) {
tester_init_ld( &ld, config, 0 );
}
if ( do_retry == config->retries ) {
fprintf( stderr, "PID=%ld - Modify(%d): entry=\"%s\".\n",

View file

@ -144,7 +144,9 @@ do_modrdn( struct tester_conn_args *config,
i = 0;
retry:;
tester_init_ld( &ld, config, 0 );
if ( ld == NULL ) {
tester_init_ld( &ld, config, 0 );
}
if ( do_retry == config->retries ) {
fprintf( stderr, "PID=%ld - Modrdn(%d): entry=\"%s\".\n",