-- v2: wldap32: Fix memory leak on error path in ldap_start_tls_sW (scan-build).
From: Alex Henrie alexhenrie24@gmail.com
--- 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 );
This merge request was approved by Hans Leidekker.