]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/request.c
ITS#8167 Fix non-blocking TLS with referrals
[openldap] / libraries / libldap / request.c
index c2d6dd445da85bebc267cb70bf4580d798880261..a6a4744d2eacc8866c1776ebb16bb1e7bac73b55 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2015 The OpenLDAP Foundation.
+ * Copyright 1998-2017 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -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;
        }