]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Do not leak lds in slapd-* tools
authorOndřej Kuzník <okuznik@symas.com>
Wed, 27 Mar 2019 10:26:44 +0000 (10:26 +0000)
committerOndřej Kuzník <ondra@openldap.org>
Wed, 27 Mar 2019 10:54:42 +0000 (10:54 +0000)
tests/progs/slapd-bind.c
tests/progs/slapd-common.c
tests/progs/slapd-modify.c
tests/progs/slapd-modrdn.c

index a275212ac7d6def49b1703afe2726df2c397c220..3f977a3553f37cc8c4915f186709d396034fbac7 100644 (file)
@@ -469,6 +469,9 @@ novals:;
 
        if ( ndns == 0 ) {
                tester_error( "No DNs" );
+               if ( ld != NULL ) {
+                       ldap_unbind_ext( ld, NULL, NULL );
+               }
                return 1;
        }
 
index a919a55e9b339654ccdf702e8e0791d73b71f786..ceda3b74f04966c04ea01970c02a8a4cc658f96a 100644 (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 );
                }
        }
index 7ea408003bb1622f31dc9439db96517b89dbe677..f8df6b4e00343518ab45a36416a03b049c0f60a3 100644 (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",
index 665a44cf7bdf14fe7379c88b963002dc7bfb642c..4fc339c5a9c30a6d9f78f4a5f56b6a9cd91dff73 100644 (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",