wldap32: Fix memory leak on error path in ldap_start_tls_sW (scan-build).

This commit is contained in:
Alex Henrie 2023-06-07 00:14:40 -06:00 committed by Alexandre Julliard
parent 7b69313bbb
commit 35dc94bc01

View file

@ -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 );