]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9908 slapd-tester: plug LDAP* leak on bind retries
authorOndřej Kuzník <ondra@mistotebe.net>
Wed, 31 Aug 2022 16:28:42 +0000 (17:28 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 12 Sep 2022 20:44:05 +0000 (20:44 +0000)
tests/progs/slapd-common.c

index d9f509e6fe5ccdf3239a8cf62fb66243e5b286ee..d28bdb3f50d3a8f50739fc22129ac67636c2ced7 100644 (file)
@@ -522,6 +522,8 @@ retry:;
 
                if ( rc != LDAP_SUCCESS ) {
                        tester_ldap_error( ld, "ldap_sasl_bind_s", NULL );
+                       ldap_unbind_ext( ld, NULL, NULL );
+                       ld = NULL;
                        switch ( rc ) {
                                case LDAP_BUSY:
                                case LDAP_UNAVAILABLE:
@@ -533,8 +535,6 @@ retry:;
                                                goto retry;
                                        }
                        }
-                       ldap_unbind_ext( ld, NULL, NULL );
-                       ld = NULL;
                        if ( !( flags & TESTER_INIT_NOEXIT ))
                                exit( EXIT_FAILURE );
                }