From 4aacc755dfbd18c3b030c912cdef17bd4c827ff5 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 2 Feb 2023 15:28:22 +0000 Subject: [PATCH] ITS#10003: ldap_open_internal_connection: fix mutex usage Note: this is a non-standard function with no use cases --- libraries/libldap/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index afef818d46..deb8c2fe4a 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -585,9 +585,9 @@ ldap_open_internal_connection( LDAP **ldp, ber_socket_t *fdp ) /* Attach the passed socket as the *LDAP's connection */ c = ldap_new_connection( ld, NULL, 1, 0, NULL, 0, 0 ); if( c == NULL ) { + LDAP_MUTEX_UNLOCK( &ld->ld_conn_mutex ); ldap_unbind_ext( ld, NULL, NULL ); *ldp = NULL; - LDAP_MUTEX_UNLOCK( &ld->ld_conn_mutex ); return( LDAP_NO_MEMORY ); } ber_sockbuf_ctrl( c->lconn_sb, LBER_SB_OPT_SET_FD, fdp ); -- 2.47.2