From: Ondřej Kuzník Date: Wed, 27 Mar 2019 10:26:44 +0000 (+0000) Subject: Do not leak lds in slapd-* tools X-Git-Tag: OPENLDAP_REL_ENG_2_5_0ALPHA~67^2~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=593512bb7b2b5d23a658d3a8d05bdeeb15d7611f;p=thirdparty%2Fopenldap.git Do not leak lds in slapd-* tools --- diff --git a/tests/progs/slapd-bind.c b/tests/progs/slapd-bind.c index a275212ac7..3f977a3553 100644 --- a/tests/progs/slapd-bind.c +++ b/tests/progs/slapd-bind.c @@ -469,6 +469,9 @@ novals:; if ( ndns == 0 ) { tester_error( "No DNs" ); + if ( ld != NULL ) { + ldap_unbind_ext( ld, NULL, NULL ); + } return 1; } diff --git a/tests/progs/slapd-common.c b/tests/progs/slapd-common.c index a919a55e9b..ceda3b74f0 100644 --- a/tests/progs/slapd-common.c +++ b/tests/progs/slapd-common.c @@ -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 ); } } diff --git a/tests/progs/slapd-modify.c b/tests/progs/slapd-modify.c index 7ea408003b..f8df6b4e00 100644 --- a/tests/progs/slapd-modify.c +++ b/tests/progs/slapd-modify.c @@ -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", diff --git a/tests/progs/slapd-modrdn.c b/tests/progs/slapd-modrdn.c index 665a44cf7b..4fc339c5a9 100644 --- a/tests/progs/slapd-modrdn.c +++ b/tests/progs/slapd-modrdn.c @@ -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",