]> git.sur5r.net Git - openldap/commitdiff
ITS#8727 plug ber leaks
authorHoward Chu <hyc@openldap.org>
Tue, 17 Jan 2017 11:35:54 +0000 (11:35 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 8 Sep 2017 15:35:32 +0000 (16:35 +0100)
libraries/libldap/request.c

index 7ec5a83622b089ca984bca035e55d54f01232f97..a6a4744d2eacc8866c1776ebb16bb1e7bac73b55 100644 (file)
@@ -315,6 +315,7 @@ ldap_send_server_request(
                LDAP_MUTEX_UNLOCK( &ld->ld_options.ldo_mutex );
                if ( rc == -1 ) {
                        ld->ld_errno = LDAP_ENCODING_ERROR;
+                       ber_free( ber, 1 );
                        LDAP_CONN_UNLOCK_IF(m_noconn);
                        return rc;
                }
@@ -334,6 +335,7 @@ ldap_send_server_request(
                rc = -1;
        }
        if ( rc ) {
+               ber_free( ber, 1 );
                LDAP_CONN_UNLOCK_IF(m_noconn);
                return rc;
        }