Module: wine Branch: master Commit: 35dc94bc012e1fee34a6514d1b7d0149d02db0b5 URL: https://gitlab.winehq.org/wine/wine/-/commit/35dc94bc012e1fee34a6514d1b7d014...
Author: Alex Henrie alexhenrie24@gmail.com Date: Wed Jun 7 00:14:40 2023 -0600
wldap32: Fix memory leak on error path in ldap_start_tls_sW (scan-build).
---
dlls/wldap32/init.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/wldap32/init.c b/dlls/wldap32/init.c index 519466da1ee..c5b11a4de28 100644 --- a/dlls/wldap32/init.c +++ b/dlls/wldap32/init.c @@ -450,14 +450,12 @@ ULONG CDECL ldap_start_tls_sW( LDAP *ld, ULONG *retval, LDAPMessage **result, LD }
if (!ld) return ~0u; + if (CONNECTED(ld)) return WLDAP32_LDAP_LOCAL_ERROR;
if (serverctrls && !(serverctrlsU = controlarrayWtoU( serverctrls ))) goto exit; if (clientctrls && !(clientctrlsU = controlarrayWtoU( clientctrls ))) goto exit; - else - { - if (CONNECTED(ld)) return WLDAP32_LDAP_LOCAL_ERROR; - ret = map_error( ldap_start_tls_s( CTX(ld), serverctrlsU, clientctrlsU ) ); - } + + ret = map_error( ldap_start_tls_s( CTX(ld), serverctrlsU, clientctrlsU ) );
exit: controlarrayfreeU( serverctrlsU );