wldap32: Fix broken parameter handling.
This commit is contained in:
parent
2d6d4e9674
commit
1bf5e2da0a
@ -214,16 +214,20 @@ INT ldap_create_vlv_controlA( WLDAP32_LDAP *ld, WLDAP32_LDAPVLVInfo *info,
|
|||||||
{
|
{
|
||||||
INT ret = LDAP_NOT_SUPPORTED;
|
INT ret = LDAP_NOT_SUPPORTED;
|
||||||
#ifdef HAVE_LDAP
|
#ifdef HAVE_LDAP
|
||||||
LDAPControlW **controlW = NULL;
|
LDAPControlW *controlW = NULL;
|
||||||
|
|
||||||
TRACE( "(%p, %p, 0x%02x, %p)\n", ld, info, critical, control );
|
TRACE( "(%p, %p, 0x%02x, %p)\n", ld, info, critical, control );
|
||||||
|
|
||||||
if (!ld) return ~0UL;
|
if (!ld || !control) return ~0UL;
|
||||||
|
|
||||||
ret = ldap_create_vlv_controlW( ld, info, critical, controlW );
|
ret = ldap_create_vlv_controlW( ld, info, critical, &controlW );
|
||||||
|
|
||||||
*control = controlWtoA( *controlW );
|
if (ret == LDAP_SUCCESS)
|
||||||
ldap_control_freeW( *controlW );
|
{
|
||||||
|
*control = controlWtoA( controlW );
|
||||||
|
if (!*control) ret = WLDAP32_LDAP_NO_MEMORY;
|
||||||
|
ldap_control_freeW( controlW );
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
@ -256,16 +260,20 @@ INT ldap_create_vlv_controlW( WLDAP32_LDAP *ld, WLDAP32_LDAPVLVInfo *info,
|
|||||||
{
|
{
|
||||||
INT ret = LDAP_NOT_SUPPORTED;
|
INT ret = LDAP_NOT_SUPPORTED;
|
||||||
#ifdef HAVE_LDAP
|
#ifdef HAVE_LDAP
|
||||||
LDAPControl **controlU = NULL;
|
LDAPControl *controlU = NULL;
|
||||||
|
|
||||||
TRACE( "(%p, %p, 0x%02x, %p)\n", ld, info, critical, control );
|
TRACE( "(%p, %p, 0x%02x, %p)\n", ld, info, critical, control );
|
||||||
|
|
||||||
if (!ld) return ~0UL;
|
if (!ld || !control) return ~0UL;
|
||||||
|
|
||||||
ret = ldap_create_vlv_control( ld, (LDAPVLVInfo *)info, controlU );
|
ret = ldap_create_vlv_control( ld, (LDAPVLVInfo *)info, &controlU );
|
||||||
|
|
||||||
*control = controlUtoW( *controlU );
|
if (ret == LDAP_SUCCESS)
|
||||||
ldap_control_free( *controlU );
|
{
|
||||||
|
*control = controlUtoW( controlU );
|
||||||
|
if (!*control) ret = WLDAP32_LDAP_NO_MEMORY;
|
||||||
|
ldap_control_free( controlU );
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user