Commit 8a52b16e authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wldap32: Use CRT memory allocators.

parent e5f1c0f7
...@@ -49,7 +49,7 @@ ULONG CDECL ldap_addA( WLDAP32_LDAP *ld, char *dn, LDAPModA **attrs ) ...@@ -49,7 +49,7 @@ ULONG CDECL ldap_addA( WLDAP32_LDAP *ld, char *dn, LDAPModA **attrs )
ret = ldap_addW( ld, dnW, attrsW ); ret = ldap_addW( ld, dnW, attrsW );
exit: exit:
strfreeW( dnW ); free( dnW );
modarrayfreeW( attrsW ); modarrayfreeW( attrsW );
return ret; return ret;
} }
...@@ -110,7 +110,7 @@ ULONG CDECL ldap_add_extA( WLDAP32_LDAP *ld, char *dn, LDAPModA **attrs, LDAPCon ...@@ -110,7 +110,7 @@ ULONG CDECL ldap_add_extA( WLDAP32_LDAP *ld, char *dn, LDAPModA **attrs, LDAPCon
ret = ldap_add_extW( ld, dnW, attrsW, serverctrlsW, clientctrlsW, message ); ret = ldap_add_extW( ld, dnW, attrsW, serverctrlsW, clientctrlsW, message );
exit: exit:
strfreeW( dnW ); free( dnW );
modarrayfreeW( attrsW ); modarrayfreeW( attrsW );
controlarrayfreeW( serverctrlsW ); controlarrayfreeW( serverctrlsW );
controlarrayfreeW( clientctrlsW ); controlarrayfreeW( clientctrlsW );
...@@ -160,7 +160,7 @@ ULONG CDECL ldap_add_extW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **attrs, LDAPCo ...@@ -160,7 +160,7 @@ ULONG CDECL ldap_add_extW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **attrs, LDAPCo
ret = map_error( ldap_funcs->ldap_add_ext( ld->ld, dnU, attrsU, serverctrlsU, clientctrlsU, message ) ); ret = map_error( ldap_funcs->ldap_add_ext( ld->ld, dnU, attrsU, serverctrlsU, clientctrlsU, message ) );
exit: exit:
strfreeU( dnU ); free( dnU );
modarrayfreeU( attrsU ); modarrayfreeU( attrsU );
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
controlarrayfreeU( clientctrlsU ); controlarrayfreeU( clientctrlsU );
...@@ -192,7 +192,7 @@ ULONG CDECL ldap_add_ext_sA( WLDAP32_LDAP *ld, char *dn, LDAPModA **attrs, LDAPC ...@@ -192,7 +192,7 @@ ULONG CDECL ldap_add_ext_sA( WLDAP32_LDAP *ld, char *dn, LDAPModA **attrs, LDAPC
ret = ldap_add_ext_sW( ld, dnW, attrsW, serverctrlsW, clientctrlsW ); ret = ldap_add_ext_sW( ld, dnW, attrsW, serverctrlsW, clientctrlsW );
exit: exit:
strfreeW( dnW ); free( dnW );
modarrayfreeW( attrsW ); modarrayfreeW( attrsW );
controlarrayfreeW( serverctrlsW ); controlarrayfreeW( serverctrlsW );
controlarrayfreeW( clientctrlsW ); controlarrayfreeW( clientctrlsW );
...@@ -240,7 +240,7 @@ ULONG CDECL ldap_add_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **attrs, LDAP ...@@ -240,7 +240,7 @@ ULONG CDECL ldap_add_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **attrs, LDAP
ret = map_error( ldap_funcs->ldap_add_ext_s( ld->ld, dnU, attrsU, serverctrlsU, clientctrlsU ) ); ret = map_error( ldap_funcs->ldap_add_ext_s( ld->ld, dnU, attrsU, serverctrlsU, clientctrlsU ) );
exit: exit:
strfreeU( dnU ); free( dnU );
modarrayfreeU( attrsU ); modarrayfreeU( attrsU );
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
controlarrayfreeU( clientctrlsU ); controlarrayfreeU( clientctrlsU );
...@@ -268,7 +268,7 @@ ULONG CDECL ldap_add_sA( WLDAP32_LDAP *ld, char *dn, LDAPModA **attrs ) ...@@ -268,7 +268,7 @@ ULONG CDECL ldap_add_sA( WLDAP32_LDAP *ld, char *dn, LDAPModA **attrs )
ret = ldap_add_sW( ld, dnW, attrsW ); ret = ldap_add_sW( ld, dnW, attrsW );
exit: exit:
strfreeW( dnW ); free( dnW );
modarrayfreeW( attrsW ); modarrayfreeW( attrsW );
return ret; return ret;
} }
......
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
*/ */
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h>
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winnls.h" #include "winnls.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h"
#include "winldap_private.h" #include "winldap_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32); WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
...@@ -48,10 +48,10 @@ WLDAP32_BerElement * CDECL WLDAP32_ber_alloc_t( int options ) ...@@ -48,10 +48,10 @@ WLDAP32_BerElement * CDECL WLDAP32_ber_alloc_t( int options )
{ {
WLDAP32_BerElement *ret; WLDAP32_BerElement *ret;
if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL; if (!(ret = malloc( sizeof(*ret) ))) return NULL;
if (!(ret->opaque = ldap_funcs->ber_alloc_t( options ))) if (!(ret->opaque = ldap_funcs->ber_alloc_t( options )))
{ {
heap_free( ret ); free( ret );
return NULL; return NULL;
} }
return ret; return ret;
...@@ -117,7 +117,7 @@ void CDECL WLDAP32_ber_bvecfree( BERVAL **berval ) ...@@ -117,7 +117,7 @@ void CDECL WLDAP32_ber_bvecfree( BERVAL **berval )
*/ */
void CDECL WLDAP32_ber_bvfree( BERVAL *berval ) void CDECL WLDAP32_ber_bvfree( BERVAL *berval )
{ {
heap_free( berval ); free( berval );
} }
...@@ -194,7 +194,7 @@ int CDECL WLDAP32_ber_flatten( WLDAP32_BerElement *ber, BERVAL **berval ) ...@@ -194,7 +194,7 @@ int CDECL WLDAP32_ber_flatten( WLDAP32_BerElement *ber, BERVAL **berval )
void CDECL WLDAP32_ber_free( WLDAP32_BerElement *ber, int freebuf ) void CDECL WLDAP32_ber_free( WLDAP32_BerElement *ber, int freebuf )
{ {
ldap_funcs->ber_free( ber->opaque, freebuf ); ldap_funcs->ber_free( ber->opaque, freebuf );
heap_free( ber ); free( ber );
} }
...@@ -218,18 +218,18 @@ WLDAP32_BerElement * CDECL WLDAP32_ber_init( BERVAL *berval ) ...@@ -218,18 +218,18 @@ WLDAP32_BerElement * CDECL WLDAP32_ber_init( BERVAL *berval )
struct bervalU *bervalU; struct bervalU *bervalU;
WLDAP32_BerElement *ret; WLDAP32_BerElement *ret;
if (!(ret = heap_alloc( sizeof(*ret) ))) return NULL; if (!(ret = malloc( sizeof(*ret) ))) return NULL;
if (!(bervalU = bervalWtoU( berval ))) if (!(bervalU = bervalWtoU( berval )))
{ {
heap_free( ret ); free( ret );
return NULL; return NULL;
} }
if (!(ret->opaque = ldap_funcs->ber_init( bervalU ))) if (!(ret->opaque = ldap_funcs->ber_init( bervalU )))
{ {
heap_free( ret ); free( ret );
ret = NULL; ret = NULL;
} }
heap_free( bervalU ); free( bervalU );
return ret; return ret;
} }
...@@ -467,7 +467,7 @@ ULONG WINAPIV WLDAP32_ber_scanf( WLDAP32_BerElement *ber, char *fmt, ... ) ...@@ -467,7 +467,7 @@ ULONG WINAPIV WLDAP32_ber_scanf( WLDAP32_BerElement *ber, char *fmt, ... )
char *strU, **str = va_arg( list, char ** ); char *strU, **str = va_arg( list, char ** );
int *len = va_arg( list, int * ); int *len = va_arg( list, int * );
if ((ret = ldap_funcs->ber_scanf( ber->opaque, new_fmt, &strU, len )) == -1) break; if ((ret = ldap_funcs->ber_scanf( ber->opaque, new_fmt, &strU, len )) == -1) break;
*str = heap_alloc( *len ); *str = malloc( *len );
memcpy( *str, strU, *len ); memcpy( *str, strU, *len );
ldap_funcs->ldap_memfree( strU ); ldap_funcs->ldap_memfree( strU );
break; break;
......
...@@ -19,13 +19,13 @@ ...@@ -19,13 +19,13 @@
*/ */
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h>
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winnls.h" #include "winnls.h"
#include "rpc.h" #include "rpc.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h"
#include "winldap_private.h" #include "winldap_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32); WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
...@@ -50,8 +50,8 @@ ULONG CDECL ldap_bindA( WLDAP32_LDAP *ld, char *dn, char *cred, ULONG method ) ...@@ -50,8 +50,8 @@ ULONG CDECL ldap_bindA( WLDAP32_LDAP *ld, char *dn, char *cred, ULONG method )
ret = ldap_bindW( ld, dnW, credW, method ); ret = ldap_bindW( ld, dnW, credW, method );
exit: exit:
strfreeW( dnW ); free( dnW );
strfreeW( credW ); free( credW );
return ret; return ret;
} }
...@@ -100,8 +100,8 @@ ULONG CDECL ldap_bindW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method ) ...@@ -100,8 +100,8 @@ ULONG CDECL ldap_bindW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method )
ret = ~0u; ret = ~0u;
exit: exit:
strfreeU( dnU ); free( dnU );
strfreeU( credU ); free( credU );
return ret; return ret;
} }
...@@ -132,8 +132,8 @@ ULONG CDECL ldap_bind_sA( WLDAP32_LDAP *ld, char *dn, char *cred, ULONG method ) ...@@ -132,8 +132,8 @@ ULONG CDECL ldap_bind_sA( WLDAP32_LDAP *ld, char *dn, char *cred, ULONG method )
ret = ldap_bind_sW( ld, dnW, credW, method ); ret = ldap_bind_sW( ld, dnW, credW, method );
exit: exit:
strfreeW( dnW ); free( dnW );
if (credW != (WCHAR *)cred) strfreeW( credW ); if (credW != (WCHAR *)cred) free( credW );
return ret; return ret;
} }
...@@ -235,14 +235,14 @@ ULONG CDECL ldap_bind_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method ...@@ -235,14 +235,14 @@ ULONG CDECL ldap_bind_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method
if (id && (id->Flags & SEC_WINNT_AUTH_IDENTITY_ANSI)) if (id && (id->Flags & SEC_WINNT_AUTH_IDENTITY_ANSI))
{ {
strfreeW( (WCHAR *)idW.Domain ); free( (WCHAR *)idW.Domain );
strfreeW( (WCHAR *)idW.User ); free( (WCHAR *)idW.User );
strfreeW( (WCHAR *)idW.Password ); free( (WCHAR *)idW.Password );
} }
strfreeU( (char *)idU.Domain ); free( (char *)idU.Domain );
strfreeU( (char *)idU.User ); free( (char *)idU.User );
strfreeU( (char *)idU.Password ); free( (char *)idU.Password );
} }
else else
{ {
...@@ -251,8 +251,8 @@ ULONG CDECL ldap_bind_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method ...@@ -251,8 +251,8 @@ ULONG CDECL ldap_bind_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *cred, ULONG method
} }
exit: exit:
strfreeU( dnU ); free( dnU );
strfreeU( credU ); free( credU );
return ret; return ret;
} }
...@@ -282,8 +282,8 @@ ULONG CDECL ldap_sasl_bindA( WLDAP32_LDAP *ld, const PCHAR dn, const PCHAR mecha ...@@ -282,8 +282,8 @@ ULONG CDECL ldap_sasl_bindA( WLDAP32_LDAP *ld, const PCHAR dn, const PCHAR mecha
ret = ldap_sasl_bindW( ld, dnW, mechanismW, cred, serverctrlsW, clientctrlsW, message ); ret = ldap_sasl_bindW( ld, dnW, mechanismW, cred, serverctrlsW, clientctrlsW, message );
exit: exit:
strfreeW( dnW ); free( dnW );
strfreeW( mechanismW ); free( mechanismW );
controlarrayfreeW( serverctrlsW ); controlarrayfreeW( serverctrlsW );
controlarrayfreeW( clientctrlsW ); controlarrayfreeW( clientctrlsW );
return ret; return ret;
...@@ -336,8 +336,8 @@ ULONG CDECL ldap_sasl_bindW( WLDAP32_LDAP *ld, const PWCHAR dn, const PWCHAR mec ...@@ -336,8 +336,8 @@ ULONG CDECL ldap_sasl_bindW( WLDAP32_LDAP *ld, const PWCHAR dn, const PWCHAR mec
ret = map_error( ldap_funcs->ldap_sasl_bind( ld->ld, dnU, mechanismU, &credU, serverctrlsU, clientctrlsU, message ) ); ret = map_error( ldap_funcs->ldap_sasl_bind( ld->ld, dnU, mechanismU, &credU, serverctrlsU, clientctrlsU, message ) );
exit: exit:
strfreeU( dnU ); free( dnU );
strfreeU( mechanismU ); free( mechanismU );
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
controlarrayfreeU( clientctrlsU ); controlarrayfreeU( clientctrlsU );
return ret; return ret;
...@@ -369,8 +369,8 @@ ULONG CDECL ldap_sasl_bind_sA( WLDAP32_LDAP *ld, const PCHAR dn, const PCHAR mec ...@@ -369,8 +369,8 @@ ULONG CDECL ldap_sasl_bind_sA( WLDAP32_LDAP *ld, const PCHAR dn, const PCHAR mec
ret = ldap_sasl_bind_sW( ld, dnW, mechanismW, cred, serverctrlsW, clientctrlsW, serverdata ); ret = ldap_sasl_bind_sW( ld, dnW, mechanismW, cred, serverctrlsW, clientctrlsW, serverdata );
exit: exit:
strfreeW( dnW ); free( dnW );
strfreeW( mechanismW ); free( mechanismW );
controlarrayfreeW( serverctrlsW ); controlarrayfreeW( serverctrlsW );
controlarrayfreeW( clientctrlsW ); controlarrayfreeW( clientctrlsW );
return ret; return ret;
...@@ -431,8 +431,8 @@ ULONG CDECL ldap_sasl_bind_sW( WLDAP32_LDAP *ld, const PWCHAR dn, ...@@ -431,8 +431,8 @@ ULONG CDECL ldap_sasl_bind_sW( WLDAP32_LDAP *ld, const PWCHAR dn,
} }
exit: exit:
strfreeU( dnU ); free( dnU );
strfreeU( mechanismU ); free( mechanismU );
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
controlarrayfreeU( clientctrlsU ); controlarrayfreeU( clientctrlsU );
return ret; return ret;
...@@ -458,8 +458,8 @@ ULONG CDECL ldap_simple_bindA( WLDAP32_LDAP *ld, char *dn, char *passwd ) ...@@ -458,8 +458,8 @@ ULONG CDECL ldap_simple_bindA( WLDAP32_LDAP *ld, char *dn, char *passwd )
ret = ldap_simple_bindW( ld, dnW, passwdW ); ret = ldap_simple_bindW( ld, dnW, passwdW );
exit: exit:
strfreeW( dnW ); free( dnW );
strfreeW( passwdW ); free( passwdW );
return ret; return ret;
} }
...@@ -506,8 +506,8 @@ ULONG CDECL ldap_simple_bindW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *passwd ) ...@@ -506,8 +506,8 @@ ULONG CDECL ldap_simple_bindW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *passwd )
ret = ~0u; ret = ~0u;
exit: exit:
strfreeU( dnU ); free( dnU );
strfreeU( passwdU ); free( passwdU );
return ret; return ret;
} }
...@@ -531,8 +531,8 @@ ULONG CDECL ldap_simple_bind_sA( WLDAP32_LDAP *ld, char *dn, char *passwd ) ...@@ -531,8 +531,8 @@ ULONG CDECL ldap_simple_bind_sA( WLDAP32_LDAP *ld, char *dn, char *passwd )
ret = ldap_simple_bind_sW( ld, dnW, passwdW ); ret = ldap_simple_bind_sW( ld, dnW, passwdW );
exit: exit:
strfreeW( dnW ); free( dnW );
strfreeW( passwdW ); free( passwdW );
return ret; return ret;
} }
...@@ -574,8 +574,8 @@ ULONG CDECL ldap_simple_bind_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *passwd ) ...@@ -574,8 +574,8 @@ ULONG CDECL ldap_simple_bind_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *passwd )
ret = map_error( ldap_funcs->ldap_sasl_bind_s( ld->ld, dnU, 0, &pwd, NULL, NULL, NULL ) ); ret = map_error( ldap_funcs->ldap_sasl_bind_s( ld->ld, dnU, 0, &pwd, NULL, NULL, NULL ) );
exit: exit:
strfreeU( dnU ); free( dnU );
strfreeU( passwdU ); free( passwdU );
return ret; return ret;
} }
...@@ -602,7 +602,7 @@ ULONG CDECL WLDAP32_ldap_unbind( WLDAP32_LDAP *ld ) ...@@ -602,7 +602,7 @@ ULONG CDECL WLDAP32_ldap_unbind( WLDAP32_LDAP *ld )
ret = map_error( ldap_funcs->ldap_unbind_ext( ld->ld, NULL, NULL )); ret = map_error( ldap_funcs->ldap_unbind_ext( ld->ld, NULL, NULL ));
if (ld->ld_server_ctrls) ldap_funcs->ldap_value_free_len( ld->ld_server_ctrls ); if (ld->ld_server_ctrls) ldap_funcs->ldap_value_free_len( ld->ld_server_ctrls );
heap_free( ld ); free( ld );
return ret; return ret;
} }
...@@ -629,6 +629,6 @@ ULONG CDECL WLDAP32_ldap_unbind_s( WLDAP32_LDAP *ld ) ...@@ -629,6 +629,6 @@ ULONG CDECL WLDAP32_ldap_unbind_s( WLDAP32_LDAP *ld )
ret = map_error( ldap_funcs->ldap_unbind_ext_s( ld->ld, NULL, NULL ) ); ret = map_error( ldap_funcs->ldap_unbind_ext_s( ld->ld, NULL, NULL ) );
if (ld->ld_server_ctrls) ldap_funcs->ldap_value_free_len( ld->ld_server_ctrls ); if (ld->ld_server_ctrls) ldap_funcs->ldap_value_free_len( ld->ld_server_ctrls );
heap_free( ld ); free( ld );
return ret; return ret;
} }
...@@ -49,9 +49,9 @@ ULONG CDECL ldap_compareA( WLDAP32_LDAP *ld, char *dn, char *attr, char *value ) ...@@ -49,9 +49,9 @@ ULONG CDECL ldap_compareA( WLDAP32_LDAP *ld, char *dn, char *attr, char *value )
ret = ldap_compareW( ld, dnW, attrW, valueW ); ret = ldap_compareW( ld, dnW, attrW, valueW );
exit: exit:
strfreeW( dnW ); free( dnW );
strfreeW( attrW ); free( attrW );
strfreeW( valueW ); free( valueW );
return ret; return ret;
} }
...@@ -108,9 +108,9 @@ ULONG CDECL ldap_compare_extA( WLDAP32_LDAP *ld, char *dn, char *attr, char *val ...@@ -108,9 +108,9 @@ ULONG CDECL ldap_compare_extA( WLDAP32_LDAP *ld, char *dn, char *attr, char *val
ret = ldap_compare_extW( ld, dnW, attrW, valueW, data, serverctrlsW, clientctrlsW, message ); ret = ldap_compare_extW( ld, dnW, attrW, valueW, data, serverctrlsW, clientctrlsW, message );
exit: exit:
strfreeW( dnW ); free( dnW );
strfreeW( attrW ); free( attrW );
strfreeW( valueW ); free( valueW );
controlarrayfreeW( serverctrlsW ); controlarrayfreeW( serverctrlsW );
controlarrayfreeW( clientctrlsW ); controlarrayfreeW( clientctrlsW );
return ret; return ret;
...@@ -173,9 +173,9 @@ ULONG CDECL ldap_compare_extW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR * ...@@ -173,9 +173,9 @@ ULONG CDECL ldap_compare_extW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR *
ret = map_error( ldap_funcs->ldap_compare_ext( ld->ld, dnU, attrU, dataU ? dataU : &val, serverctrlsU, ret = map_error( ldap_funcs->ldap_compare_ext( ld->ld, dnU, attrU, dataU ? dataU : &val, serverctrlsU,
clientctrlsU, message ) ); clientctrlsU, message ) );
exit: exit:
strfreeU( dnU ); free( dnU );
strfreeU( attrU ); free( attrU );
strfreeU( valueU ); free( valueU );
bvfreeU( dataU ); bvfreeU( dataU );
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
controlarrayfreeU( clientctrlsU ); controlarrayfreeU( clientctrlsU );
...@@ -208,9 +208,9 @@ ULONG CDECL ldap_compare_ext_sA( WLDAP32_LDAP *ld, char *dn, char *attr, char *v ...@@ -208,9 +208,9 @@ ULONG CDECL ldap_compare_ext_sA( WLDAP32_LDAP *ld, char *dn, char *attr, char *v
ret = ldap_compare_ext_sW( ld, dnW, attrW, valueW, data, serverctrlsW, clientctrlsW ); ret = ldap_compare_ext_sW( ld, dnW, attrW, valueW, data, serverctrlsW, clientctrlsW );
exit: exit:
strfreeW( dnW ); free( dnW );
strfreeW( attrW ); free( attrW );
strfreeW( valueW ); free( valueW );
controlarrayfreeW( serverctrlsW ); controlarrayfreeW( serverctrlsW );
controlarrayfreeW( clientctrlsW ); controlarrayfreeW( clientctrlsW );
return ret; return ret;
...@@ -271,9 +271,9 @@ ULONG CDECL ldap_compare_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR ...@@ -271,9 +271,9 @@ ULONG CDECL ldap_compare_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *attr, WCHAR
ret = map_error( ldap_funcs->ldap_compare_ext_s( ld->ld, dnU, attrU, dataU ? dataU : &val, serverctrlsU, ret = map_error( ldap_funcs->ldap_compare_ext_s( ld->ld, dnU, attrU, dataU ? dataU : &val, serverctrlsU,
clientctrlsU ) ); clientctrlsU ) );
exit: exit:
strfreeU( dnU ); free( dnU );
strfreeU( attrU ); free( attrU );
strfreeU( valueU ); free( valueU );
bvfreeU( dataU ); bvfreeU( dataU );
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
controlarrayfreeU( clientctrlsU ); controlarrayfreeU( clientctrlsU );
...@@ -301,9 +301,9 @@ ULONG CDECL ldap_compare_sA( WLDAP32_LDAP *ld, PCHAR dn, PCHAR attr, PCHAR value ...@@ -301,9 +301,9 @@ ULONG CDECL ldap_compare_sA( WLDAP32_LDAP *ld, PCHAR dn, PCHAR attr, PCHAR value
ret = ldap_compare_sW( ld, dnW, attrW, valueW ); ret = ldap_compare_sW( ld, dnW, attrW, valueW );
exit: exit:
strfreeW( dnW ); free( dnW );
strfreeW( attrW ); free( attrW );
strfreeW( valueW ); free( valueW );
return ret; return ret;
} }
......
...@@ -44,7 +44,7 @@ ULONG CDECL ldap_deleteA( WLDAP32_LDAP *ld, char *dn ) ...@@ -44,7 +44,7 @@ ULONG CDECL ldap_deleteA( WLDAP32_LDAP *ld, char *dn )
if (dn && !(dnW = strAtoW( dn ))) return WLDAP32_LDAP_NO_MEMORY; if (dn && !(dnW = strAtoW( dn ))) return WLDAP32_LDAP_NO_MEMORY;
ret = ldap_deleteW( ld, dnW ); ret = ldap_deleteW( ld, dnW );
strfreeW( dnW ); free( dnW );
return ret; return ret;
} }
...@@ -100,7 +100,7 @@ ULONG CDECL ldap_delete_extA( WLDAP32_LDAP *ld, char *dn, LDAPControlA **serverc ...@@ -100,7 +100,7 @@ ULONG CDECL ldap_delete_extA( WLDAP32_LDAP *ld, char *dn, LDAPControlA **serverc
ret = ldap_delete_extW( ld, dnW, serverctrlsW, clientctrlsW, message ); ret = ldap_delete_extW( ld, dnW, serverctrlsW, clientctrlsW, message );
exit: exit:
strfreeW( dnW ); free( dnW );
controlarrayfreeW( serverctrlsW ); controlarrayfreeW( serverctrlsW );
controlarrayfreeW( clientctrlsW ); controlarrayfreeW( clientctrlsW );
return ret; return ret;
...@@ -145,7 +145,7 @@ ULONG CDECL ldap_delete_extW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPControlW **server ...@@ -145,7 +145,7 @@ ULONG CDECL ldap_delete_extW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPControlW **server
ret = map_error( ldap_funcs->ldap_delete_ext( ld->ld, dnU, serverctrlsU, clientctrlsU, message ) ); ret = map_error( ldap_funcs->ldap_delete_ext( ld->ld, dnU, serverctrlsU, clientctrlsU, message ) );
exit: exit:
strfreeU( dnU ); free( dnU );
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
controlarrayfreeU( clientctrlsU ); controlarrayfreeU( clientctrlsU );
return ret; return ret;
...@@ -174,7 +174,7 @@ ULONG CDECL ldap_delete_ext_sA( WLDAP32_LDAP *ld, char *dn, LDAPControlA **serve ...@@ -174,7 +174,7 @@ ULONG CDECL ldap_delete_ext_sA( WLDAP32_LDAP *ld, char *dn, LDAPControlA **serve
ret = ldap_delete_ext_sW( ld, dnW, serverctrlsW, clientctrlsW ); ret = ldap_delete_ext_sW( ld, dnW, serverctrlsW, clientctrlsW );
exit: exit:
strfreeW( dnW ); free( dnW );
controlarrayfreeW( serverctrlsW ); controlarrayfreeW( serverctrlsW );
controlarrayfreeW( clientctrlsW ); controlarrayfreeW( clientctrlsW );
return ret; return ret;
...@@ -217,7 +217,7 @@ ULONG CDECL ldap_delete_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPControlW **serv ...@@ -217,7 +217,7 @@ ULONG CDECL ldap_delete_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPControlW **serv
ret = map_error( ldap_funcs->ldap_delete_ext_s( ld->ld, dnU, serverctrlsU, clientctrlsU ) ); ret = map_error( ldap_funcs->ldap_delete_ext_s( ld->ld, dnU, serverctrlsU, clientctrlsU ) );
exit: exit:
strfreeU( dnU ); free( dnU );
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
controlarrayfreeU( clientctrlsU ); controlarrayfreeU( clientctrlsU );
return ret; return ret;
...@@ -239,7 +239,7 @@ ULONG CDECL ldap_delete_sA( WLDAP32_LDAP *ld, char *dn ) ...@@ -239,7 +239,7 @@ ULONG CDECL ldap_delete_sA( WLDAP32_LDAP *ld, char *dn )
if (dn && !(dnW = strAtoW( dn ))) return WLDAP32_LDAP_NO_MEMORY; if (dn && !(dnW = strAtoW( dn ))) return WLDAP32_LDAP_NO_MEMORY;
ret = ldap_delete_sW( ld, dnW ); ret = ldap_delete_sW( ld, dnW );
strfreeW( dnW ); free( dnW );
return ret; return ret;
} }
......
...@@ -45,7 +45,7 @@ char * CDECL ldap_dn2ufnA( char *dn ) ...@@ -45,7 +45,7 @@ char * CDECL ldap_dn2ufnA( char *dn )
retW = ldap_dn2ufnW( dnW ); retW = ldap_dn2ufnW( dnW );
ret = strWtoA( retW ); ret = strWtoA( retW );
strfreeW( dnW ); free( dnW );
ldap_memfreeW( retW ); ldap_memfreeW( retW );
return ret; return ret;
} }
...@@ -77,7 +77,7 @@ WCHAR * CDECL ldap_dn2ufnW( WCHAR *dn ) ...@@ -77,7 +77,7 @@ WCHAR * CDECL ldap_dn2ufnW( WCHAR *dn )
retU = ldap_funcs->ldap_dn2ufn( dnU ); retU = ldap_funcs->ldap_dn2ufn( dnU );
ret = strUtoW( retU ); ret = strUtoW( retU );
strfreeU( dnU ); free( dnU );
ldap_funcs->ldap_memfree( retU ); ldap_funcs->ldap_memfree( retU );
return ret; return ret;
} }
...@@ -99,7 +99,7 @@ char ** CDECL ldap_explode_dnA( char *dn, ULONG notypes ) ...@@ -99,7 +99,7 @@ char ** CDECL ldap_explode_dnA( char *dn, ULONG notypes )
retW = ldap_explode_dnW( dnW, notypes ); retW = ldap_explode_dnW( dnW, notypes );
ret = strarrayWtoA( retW ); ret = strarrayWtoA( retW );
strfreeW( dnW ); free( dnW );
ldap_value_freeW( retW ); ldap_value_freeW( retW );
return ret; return ret;
} }
...@@ -133,7 +133,7 @@ WCHAR ** CDECL ldap_explode_dnW( WCHAR *dn, ULONG notypes ) ...@@ -133,7 +133,7 @@ WCHAR ** CDECL ldap_explode_dnW( WCHAR *dn, ULONG notypes )
retU = ldap_funcs->ldap_explode_dn( dnU, notypes ); retU = ldap_funcs->ldap_explode_dn( dnU, notypes );
ret = strarrayUtoW( retU ); ret = strarrayUtoW( retU );
strfreeU( dnU ); free( dnU );
ldap_funcs->ldap_memvfree( (void **)retU ); ldap_funcs->ldap_memvfree( (void **)retU );
return ret; return ret;
} }
...@@ -216,7 +216,7 @@ ULONG CDECL ldap_ufn2dnA( char *ufn, char **dn ) ...@@ -216,7 +216,7 @@ ULONG CDECL ldap_ufn2dnA( char *ufn, char **dn )
else *dn = str; else *dn = str;
} }
strfreeW( ufnW ); free( ufnW );
ldap_memfreeW( dnW ); ldap_memfreeW( dnW );
return ret; return ret;
} }
...@@ -257,6 +257,6 @@ ULONG CDECL ldap_ufn2dnW( WCHAR *ufn, WCHAR **dn ) ...@@ -257,6 +257,6 @@ ULONG CDECL ldap_ufn2dnW( WCHAR *ufn, WCHAR **dn )
else *dn = str; else *dn = str;
} }
strfreeU( ufnU ); free( ufnU );
return ret; return ret;
} }
...@@ -76,7 +76,7 @@ ULONG CDECL ldap_extended_operationA( WLDAP32_LDAP *ld, char *oid, struct WLDAP3 ...@@ -76,7 +76,7 @@ ULONG CDECL ldap_extended_operationA( WLDAP32_LDAP *ld, char *oid, struct WLDAP3
ret = ldap_extended_operationW( ld, oidW, data, serverctrlsW, clientctrlsW, message ); ret = ldap_extended_operationW( ld, oidW, data, serverctrlsW, clientctrlsW, message );
exit: exit:
strfreeW( oidW ); free( oidW );
controlarrayfreeW( serverctrlsW ); controlarrayfreeW( serverctrlsW );
controlarrayfreeW( clientctrlsW ); controlarrayfreeW( clientctrlsW );
return ret; return ret;
...@@ -127,7 +127,7 @@ ULONG CDECL ldap_extended_operationW( WLDAP32_LDAP *ld, WCHAR *oid, struct WLDAP ...@@ -127,7 +127,7 @@ ULONG CDECL ldap_extended_operationW( WLDAP32_LDAP *ld, WCHAR *oid, struct WLDAP
ret = map_error( ldap_funcs->ldap_extended_operation( ld->ld, oidU, dataU, serverctrlsU, clientctrlsU, message ) ); ret = map_error( ldap_funcs->ldap_extended_operation( ld->ld, oidU, dataU, serverctrlsU, clientctrlsU, message ) );
exit: exit:
strfreeU( oidU ); free( oidU );
bvfreeU( dataU ); bvfreeU( dataU );
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
controlarrayfreeU( clientctrlsU ); controlarrayfreeU( clientctrlsU );
...@@ -164,7 +164,7 @@ ULONG CDECL ldap_extended_operation_sA( WLDAP32_LDAP *ld, char *oid, struct WLDA ...@@ -164,7 +164,7 @@ ULONG CDECL ldap_extended_operation_sA( WLDAP32_LDAP *ld, char *oid, struct WLDA
} }
exit: exit:
strfreeW( oidW ); free( oidW );
controlarrayfreeW( serverctrlsW ); controlarrayfreeW( serverctrlsW );
controlarrayfreeW( clientctrlsW ); controlarrayfreeW( clientctrlsW );
return ret; return ret;
...@@ -229,7 +229,7 @@ ULONG CDECL ldap_extended_operation_sW( WLDAP32_LDAP *ld, WCHAR *oid, struct WLD ...@@ -229,7 +229,7 @@ ULONG CDECL ldap_extended_operation_sW( WLDAP32_LDAP *ld, WCHAR *oid, struct WLD
} }
exit: exit:
strfreeU( oidU ); free( oidU );
bvfreeU( dataU ); bvfreeU( dataU );
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
controlarrayfreeU( clientctrlsU ); controlarrayfreeU( clientctrlsU );
......
...@@ -19,13 +19,13 @@ ...@@ -19,13 +19,13 @@
*/ */
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h>
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winnls.h" #include "winnls.h"
#include "winternl.h" #include "winternl.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h"
#include "winldap_private.h" #include "winldap_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32); WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
...@@ -56,9 +56,9 @@ static char **split_hostnames( const char *hostnames ) ...@@ -56,9 +56,9 @@ static char **split_hostnames( const char *hostnames )
p++; p++;
} }
if (!(res = heap_alloc( (i + 1) * sizeof(char *) ))) if (!(res = malloc( (i + 1) * sizeof(char *) )))
{ {
heap_free( str ); free( str );
return NULL; return NULL;
} }
...@@ -93,15 +93,13 @@ static char **split_hostnames( const char *hostnames ) ...@@ -93,15 +93,13 @@ static char **split_hostnames( const char *hostnames )
} }
res[i] = NULL; res[i] = NULL;
heap_free( str ); free( str );
return res; return res;
oom: oom:
while (i > 0) strfreeU( res[--i] ); while (i > 0) free( res[--i] );
free( res );
heap_free( res ); free( str );
heap_free( str );
return NULL; return NULL;
} }
...@@ -147,7 +145,7 @@ static char *join_hostnames( const char *scheme, char **hostnames, ULONG portnum ...@@ -147,7 +145,7 @@ static char *join_hostnames( const char *scheme, char **hostnames, ULONG portnum
} }
size += (i - 1) * strlen( sep ); size += (i - 1) * strlen( sep );
if (!(res = heap_alloc( size + 1 ))) return NULL; if (!(res = malloc( size + 1 ))) return NULL;
p = res; p = res;
for (v = hostnames; *v; v++) for (v = hostnames; *v; v++)
...@@ -200,10 +198,10 @@ static WLDAP32_LDAP *create_context( const char *url ) ...@@ -200,10 +198,10 @@ static WLDAP32_LDAP *create_context( const char *url )
WLDAP32_LDAP *ld; WLDAP32_LDAP *ld;
int version = WLDAP32_LDAP_VERSION3; int version = WLDAP32_LDAP_VERSION3;
if (!(ld = heap_alloc_zero( sizeof( *ld )))) return NULL; if (!(ld = calloc( 1, sizeof( *ld )))) return NULL;
if (map_error( ldap_funcs->ldap_initialize( &ld->ld, url ) ) != WLDAP32_LDAP_SUCCESS) if (map_error( ldap_funcs->ldap_initialize( &ld->ld, url ) ) != WLDAP32_LDAP_SUCCESS)
{ {
heap_free( ld ); free( ld );
return NULL; return NULL;
} }
ldap_funcs->ldap_set_option( ld->ld, WLDAP32_LDAP_OPT_PROTOCOL_VERSION, &version ); ldap_funcs->ldap_set_option( ld->ld, WLDAP32_LDAP_OPT_PROTOCOL_VERSION, &version );
...@@ -226,7 +224,7 @@ WLDAP32_LDAP * CDECL cldap_openA( char *hostname, ULONG portnumber ) ...@@ -226,7 +224,7 @@ WLDAP32_LDAP * CDECL cldap_openA( char *hostname, ULONG portnumber )
ld = cldap_openW( hostnameW, portnumber ); ld = cldap_openW( hostnameW, portnumber );
strfreeW( hostnameW ); free( hostnameW );
return ld; return ld;
} }
...@@ -264,8 +262,8 @@ WLDAP32_LDAP * CDECL cldap_openW( WCHAR *hostname, ULONG portnumber ) ...@@ -264,8 +262,8 @@ WLDAP32_LDAP * CDECL cldap_openW( WCHAR *hostname, ULONG portnumber )
ld = create_context( url ); ld = create_context( url );
exit: exit:
strfreeU( hostnameU ); free( hostnameU );
strfreeU( url ); free( url );
return ld; return ld;
} }
...@@ -311,7 +309,7 @@ WLDAP32_LDAP * CDECL ldap_initA( const PCHAR hostname, ULONG portnumber ) ...@@ -311,7 +309,7 @@ WLDAP32_LDAP * CDECL ldap_initA( const PCHAR hostname, ULONG portnumber )
ld = ldap_initW( hostnameW, portnumber ); ld = ldap_initW( hostnameW, portnumber );
strfreeW( hostnameW ); free( hostnameW );
return ld; return ld;
} }
...@@ -350,8 +348,8 @@ WLDAP32_LDAP * CDECL ldap_initW( const PWCHAR hostname, ULONG portnumber ) ...@@ -350,8 +348,8 @@ WLDAP32_LDAP * CDECL ldap_initW( const PWCHAR hostname, ULONG portnumber )
ld = create_context( url ); ld = create_context( url );
exit: exit:
strfreeU( hostnameU ); free( hostnameU );
strfreeU( url ); free( url );
return ld; return ld;
} }
...@@ -371,7 +369,7 @@ WLDAP32_LDAP * CDECL ldap_openA( char *hostname, ULONG portnumber ) ...@@ -371,7 +369,7 @@ WLDAP32_LDAP * CDECL ldap_openA( char *hostname, ULONG portnumber )
ld = ldap_openW( hostnameW, portnumber ); ld = ldap_openW( hostnameW, portnumber );
strfreeW( hostnameW ); free( hostnameW );
return ld; return ld;
} }
...@@ -409,8 +407,8 @@ WLDAP32_LDAP * CDECL ldap_openW( WCHAR *hostname, ULONG portnumber ) ...@@ -409,8 +407,8 @@ WLDAP32_LDAP * CDECL ldap_openW( WCHAR *hostname, ULONG portnumber )
ld = create_context( url ); ld = create_context( url );
exit: exit:
strfreeU( hostnameU ); free( hostnameU );
strfreeU( url ); free( url );
return ld; return ld;
} }
...@@ -430,7 +428,7 @@ WLDAP32_LDAP * CDECL ldap_sslinitA( char *hostname, ULONG portnumber, int secure ...@@ -430,7 +428,7 @@ WLDAP32_LDAP * CDECL ldap_sslinitA( char *hostname, ULONG portnumber, int secure
ld = ldap_sslinitW( hostnameW, portnumber, secure ); ld = ldap_sslinitW( hostnameW, portnumber, secure );
strfreeW( hostnameW ); free( hostnameW );
return ld; return ld;
} }
...@@ -475,8 +473,8 @@ WLDAP32_LDAP * CDECL ldap_sslinitW( WCHAR *hostname, ULONG portnumber, int secur ...@@ -475,8 +473,8 @@ WLDAP32_LDAP * CDECL ldap_sslinitW( WCHAR *hostname, ULONG portnumber, int secur
ld = create_context( url ); ld = create_context( url );
exit: exit:
strfreeU( hostnameU ); free( hostnameU );
strfreeU( url ); free( url );
return ld; return ld;
} }
......
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
*/ */
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h>
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winnls.h" #include "winnls.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h"
#include "winldap_private.h" #include "winldap_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32); WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
...@@ -67,7 +67,7 @@ ULONG CDECL ldap_check_filterA( WLDAP32_LDAP *ld, char *filter ) ...@@ -67,7 +67,7 @@ ULONG CDECL ldap_check_filterA( WLDAP32_LDAP *ld, char *filter )
ret = ldap_check_filterW( ld, filterW ); ret = ldap_check_filterW( ld, filterW );
strfreeW( filterW ); free( filterW );
return ret; return ret;
} }
...@@ -299,7 +299,7 @@ WCHAR * CDECL ldap_first_attributeW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entr ...@@ -299,7 +299,7 @@ WCHAR * CDECL ldap_first_attributeW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entr
if (!ld || !entry) return NULL; if (!ld || !entry) return NULL;
retU = ldap_funcs->ldap_first_attribute( ld->ld, entry->Request, &berU ); retU = ldap_funcs->ldap_first_attribute( ld->ld, entry->Request, &berU );
if (retU && (ber = heap_alloc( sizeof(*ber) ))) if (retU && (ber = malloc( sizeof(*ber) )))
{ {
ber->opaque = (char *)berU; ber->opaque = (char *)berU;
*ptr = ber; *ptr = ber;
...@@ -383,7 +383,7 @@ WLDAP32_LDAPMessage * CDECL WLDAP32_ldap_first_reference( WLDAP32_LDAP *ld, WLDA ...@@ -383,7 +383,7 @@ WLDAP32_LDAPMessage * CDECL WLDAP32_ldap_first_reference( WLDAP32_LDAP *ld, WLDA
void CDECL ldap_memfreeA( char *block ) void CDECL ldap_memfreeA( char *block )
{ {
TRACE( "(%p)\n", block ); TRACE( "(%p)\n", block );
strfreeA( block ); free( block );
} }
/*********************************************************************** /***********************************************************************
...@@ -397,7 +397,7 @@ void CDECL ldap_memfreeA( char *block ) ...@@ -397,7 +397,7 @@ void CDECL ldap_memfreeA( char *block )
void CDECL ldap_memfreeW( WCHAR *block ) void CDECL ldap_memfreeW( WCHAR *block )
{ {
TRACE( "(%p)\n", block ); TRACE( "(%p)\n", block );
strfreeW( block ); free( block );
} }
/*********************************************************************** /***********************************************************************
...@@ -421,7 +421,7 @@ ULONG CDECL WLDAP32_ldap_msgfree( WLDAP32_LDAPMessage *res ) ...@@ -421,7 +421,7 @@ ULONG CDECL WLDAP32_ldap_msgfree( WLDAP32_LDAPMessage *res )
{ {
entry = list; entry = list;
list = entry->lm_next; list = entry->lm_next;
heap_free( entry ); free( entry );
} }
return WLDAP32_LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
...@@ -516,7 +516,7 @@ WLDAP32_LDAPMessage * CDECL WLDAP32_ldap_next_entry( WLDAP32_LDAP *ld, WLDAP32_L ...@@ -516,7 +516,7 @@ WLDAP32_LDAPMessage * CDECL WLDAP32_ldap_next_entry( WLDAP32_LDAP *ld, WLDAP32_L
if (entry->lm_next) return entry->lm_next; if (entry->lm_next) return entry->lm_next;
msgU = ldap_funcs->ldap_next_entry( ld->ld, entry->Request ); msgU = ldap_funcs->ldap_next_entry( ld->ld, entry->Request );
if (msgU && (msg = heap_alloc_zero( sizeof(*msg) ))) if (msgU && (msg = calloc( 1, sizeof(*msg) )))
{ {
msg->Request = msgU; msg->Request = msgU;
entry->lm_next = msg; entry->lm_next = msg;
...@@ -553,7 +553,7 @@ WLDAP32_LDAPMessage * CDECL WLDAP32_ldap_next_reference( WLDAP32_LDAP *ld, WLDAP ...@@ -553,7 +553,7 @@ WLDAP32_LDAPMessage * CDECL WLDAP32_ldap_next_reference( WLDAP32_LDAP *ld, WLDAP
if (entry->lm_next) return entry->lm_next; if (entry->lm_next) return entry->lm_next;
msgU = ldap_funcs->ldap_next_reference( ld->ld, entry->Request ); msgU = ldap_funcs->ldap_next_reference( ld->ld, entry->Request );
if (msgU && (msg = heap_alloc_zero( sizeof(*msg) ))) if (msgU && (msg = calloc( 1, sizeof(*msg) )))
{ {
msg->Request = msgU; msg->Request = msgU;
entry->lm_next = msg; entry->lm_next = msg;
...@@ -617,7 +617,7 @@ ULONG CDECL WLDAP32_ldap_result( WLDAP32_LDAP *ld, ULONG msgid, ULONG all, struc ...@@ -617,7 +617,7 @@ ULONG CDECL WLDAP32_ldap_result( WLDAP32_LDAP *ld, ULONG msgid, ULONG all, struc
} }
ret = ldap_funcs->ldap_result( ld->ld, msgid, all, timeout ? &timeval : NULL, &msgU ); ret = ldap_funcs->ldap_result( ld->ld, msgid, all, timeout ? &timeval : NULL, &msgU );
if (msgU && (msg = heap_alloc_zero( sizeof(*msg) ))) if (msgU && (msg = calloc( 1, sizeof(*msg) )))
{ {
msg->Request = msgU; msg->Request = msgU;
*res = msg; *res = msg;
......
...@@ -49,7 +49,7 @@ ULONG CDECL ldap_modifyA( WLDAP32_LDAP *ld, char *dn, LDAPModA **mods ) ...@@ -49,7 +49,7 @@ ULONG CDECL ldap_modifyA( WLDAP32_LDAP *ld, char *dn, LDAPModA **mods )
ret = ldap_modifyW( ld, dnW, modsW ); ret = ldap_modifyW( ld, dnW, modsW );
exit: exit:
strfreeW( dnW ); free( dnW );
modarrayfreeW( modsW ); modarrayfreeW( modsW );
return ret; return ret;
} }
...@@ -110,7 +110,7 @@ ULONG CDECL ldap_modify_extA( WLDAP32_LDAP *ld, char *dn, LDAPModA **mods, ...@@ -110,7 +110,7 @@ ULONG CDECL ldap_modify_extA( WLDAP32_LDAP *ld, char *dn, LDAPModA **mods,
ret = ldap_modify_extW( ld, dnW, modsW, serverctrlsW, clientctrlsW, message ); ret = ldap_modify_extW( ld, dnW, modsW, serverctrlsW, clientctrlsW, message );
exit: exit:
strfreeW( dnW ); free( dnW );
modarrayfreeW( modsW ); modarrayfreeW( modsW );
controlarrayfreeW( serverctrlsW ); controlarrayfreeW( serverctrlsW );
controlarrayfreeW( clientctrlsW ); controlarrayfreeW( clientctrlsW );
...@@ -160,7 +160,7 @@ ULONG CDECL ldap_modify_extW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **mods, ...@@ -160,7 +160,7 @@ ULONG CDECL ldap_modify_extW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **mods,
ret = map_error( ldap_funcs->ldap_modify_ext( ld->ld, dnU, modsU, serverctrlsU, clientctrlsU, message ) ); ret = map_error( ldap_funcs->ldap_modify_ext( ld->ld, dnU, modsU, serverctrlsU, clientctrlsU, message ) );
exit: exit:
strfreeU( dnU ); free( dnU );
modarrayfreeU( modsU ); modarrayfreeU( modsU );
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
controlarrayfreeU( clientctrlsU ); controlarrayfreeU( clientctrlsU );
...@@ -192,7 +192,7 @@ ULONG CDECL ldap_modify_ext_sA( WLDAP32_LDAP *ld, char *dn, LDAPModA **mods, ...@@ -192,7 +192,7 @@ ULONG CDECL ldap_modify_ext_sA( WLDAP32_LDAP *ld, char *dn, LDAPModA **mods,
ret = ldap_modify_ext_sW( ld, dnW, modsW, serverctrlsW, clientctrlsW ); ret = ldap_modify_ext_sW( ld, dnW, modsW, serverctrlsW, clientctrlsW );
exit: exit:
strfreeW( dnW ); free( dnW );
modarrayfreeW( modsW ); modarrayfreeW( modsW );
controlarrayfreeW( serverctrlsW ); controlarrayfreeW( serverctrlsW );
controlarrayfreeW( clientctrlsW ); controlarrayfreeW( clientctrlsW );
...@@ -240,7 +240,7 @@ ULONG CDECL ldap_modify_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **mods, ...@@ -240,7 +240,7 @@ ULONG CDECL ldap_modify_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, LDAPModW **mods,
ret = map_error( ldap_funcs->ldap_modify_ext_s( ld->ld, dnU, modsU, serverctrlsU, clientctrlsU ) ); ret = map_error( ldap_funcs->ldap_modify_ext_s( ld->ld, dnU, modsU, serverctrlsU, clientctrlsU ) );
exit: exit:
strfreeU( dnU ); free( dnU );
modarrayfreeU( modsU ); modarrayfreeU( modsU );
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
controlarrayfreeU( clientctrlsU ); controlarrayfreeU( clientctrlsU );
...@@ -268,7 +268,7 @@ ULONG CDECL ldap_modify_sA( WLDAP32_LDAP *ld, char *dn, LDAPModA **mods ) ...@@ -268,7 +268,7 @@ ULONG CDECL ldap_modify_sA( WLDAP32_LDAP *ld, char *dn, LDAPModA **mods )
ret = ldap_modify_sW( ld, dnW, modsW ); ret = ldap_modify_sW( ld, dnW, modsW );
exit: exit:
strfreeW( dnW ); free( dnW );
modarrayfreeW( modsW ); modarrayfreeW( modsW );
return ret; return ret;
} }
......
...@@ -48,8 +48,8 @@ ULONG CDECL ldap_modrdnA( WLDAP32_LDAP *ld, char *dn, char *newdn ) ...@@ -48,8 +48,8 @@ ULONG CDECL ldap_modrdnA( WLDAP32_LDAP *ld, char *dn, char *newdn )
ret = ldap_modrdnW( ld, dnW, newdnW ); ret = ldap_modrdnW( ld, dnW, newdnW );
exit: exit:
strfreeW( dnW ); free( dnW );
strfreeW( newdnW ); free( newdnW );
return ret; return ret;
} }
...@@ -98,8 +98,8 @@ ULONG CDECL ldap_modrdn2A( WLDAP32_LDAP *ld, char *dn, char *newdn, int delete ) ...@@ -98,8 +98,8 @@ ULONG CDECL ldap_modrdn2A( WLDAP32_LDAP *ld, char *dn, char *newdn, int delete )
ret = ldap_modrdn2W( ld, dnW, newdnW, delete ); ret = ldap_modrdn2W( ld, dnW, newdnW, delete );
exit: exit:
strfreeW( dnW ); free( dnW );
strfreeW( newdnW ); free( newdnW );
return ret; return ret;
} }
...@@ -143,8 +143,8 @@ ULONG CDECL ldap_modrdn2W( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete ...@@ -143,8 +143,8 @@ ULONG CDECL ldap_modrdn2W( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newdn, int delete
ret = ~0u; ret = ~0u;
exit: exit:
strfreeU( dnU ); free( dnU );
strfreeU( newdnU ); free( newdnU );
return ret; return ret;
} }
...@@ -168,8 +168,8 @@ ULONG CDECL ldap_modrdn2_sA( WLDAP32_LDAP *ld, char *dn, char *newdn, int delete ...@@ -168,8 +168,8 @@ ULONG CDECL ldap_modrdn2_sA( WLDAP32_LDAP *ld, char *dn, char *newdn, int delete
ret = ldap_modrdn2_sW( ld, dnW, newdnW, delete ); ret = ldap_modrdn2_sW( ld, dnW, newdnW, delete );
exit: exit:
strfreeW( dnW ); free( dnW );
strfreeW( newdnW ); free( newdnW );
return ret; return ret;
} }
...@@ -203,8 +203,8 @@ ULONG CDECL ldap_modrdn2_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newdn, int dele ...@@ -203,8 +203,8 @@ ULONG CDECL ldap_modrdn2_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newdn, int dele
ret = map_error( ldap_funcs->ldap_rename_s( ld->ld, dnU, newdnU, NULL, delete, NULL, NULL )); ret = map_error( ldap_funcs->ldap_rename_s( ld->ld, dnU, newdnU, NULL, delete, NULL, NULL ));
exit: exit:
strfreeU( dnU ); free( dnU );
strfreeU( newdnU ); free( newdnU );
return ret; return ret;
} }
...@@ -228,8 +228,8 @@ ULONG CDECL ldap_modrdn_sA( WLDAP32_LDAP *ld, char *dn, char *newdn ) ...@@ -228,8 +228,8 @@ ULONG CDECL ldap_modrdn_sA( WLDAP32_LDAP *ld, char *dn, char *newdn )
ret = ldap_modrdn_sW( ld, dnW, newdnW ); ret = ldap_modrdn_sW( ld, dnW, newdnW );
exit: exit:
strfreeW( dnW ); free( dnW );
strfreeW( newdnW ); free( newdnW );
return ret; return ret;
} }
......
...@@ -57,7 +57,7 @@ ULONG CDECL ldap_get_optionA( WLDAP32_LDAP *ld, int option, void *value ) ...@@ -57,7 +57,7 @@ ULONG CDECL ldap_get_optionA( WLDAP32_LDAP *ld, int option, void *value )
ret = ldap_get_optionW( ld, option, &featureW ); ret = ldap_get_optionW( ld, option, &featureW );
if (ret == WLDAP32_LDAP_SUCCESS) featureA->ldapaif_version = featureW.ldapaif_version; if (ret == WLDAP32_LDAP_SUCCESS) featureA->ldapaif_version = featureW.ldapaif_version;
strfreeW( featureW.ldapaif_name ); free( featureW.ldapaif_name );
return ret; return ret;
} }
case WLDAP32_LDAP_OPT_API_INFO: case WLDAP32_LDAP_OPT_API_INFO:
...@@ -185,7 +185,7 @@ ULONG CDECL ldap_get_optionW( WLDAP32_LDAP *ld, int option, void *value ) ...@@ -185,7 +185,7 @@ ULONG CDECL ldap_get_optionW( WLDAP32_LDAP *ld, int option, void *value )
ret = map_error( ldap_funcs->ldap_get_option( ld->ld, option, &featureU ) ); ret = map_error( ldap_funcs->ldap_get_option( ld->ld, option, &featureU ) );
if (ret == WLDAP32_LDAP_SUCCESS) featureW->ldapaif_version = featureU.ldapaif_version; if (ret == WLDAP32_LDAP_SUCCESS) featureW->ldapaif_version = featureU.ldapaif_version;
strfreeU( featureU.ldapaif_name ); free( featureU.ldapaif_name );
return ret; return ret;
} }
case WLDAP32_LDAP_OPT_API_INFO: case WLDAP32_LDAP_OPT_API_INFO:
......
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
*/ */
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h>
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winnls.h" #include "winnls.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h"
#include "winldap_private.h" #include "winldap_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32); WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
...@@ -82,20 +82,20 @@ static ULONG create_page_control( ULONG pagesize, struct WLDAP32_berval *cookie, ...@@ -82,20 +82,20 @@ static ULONG create_page_control( ULONG pagesize, struct WLDAP32_berval *cookie,
if (ret == -1) return WLDAP32_LDAP_NO_MEMORY; if (ret == -1) return WLDAP32_LDAP_NO_MEMORY;
/* copy the berval so it can be properly freed by the caller */ /* copy the berval so it can be properly freed by the caller */
if (!(val = heap_alloc( berval->bv_len ))) return WLDAP32_LDAP_NO_MEMORY; if (!(val = malloc( berval->bv_len ))) return WLDAP32_LDAP_NO_MEMORY;
len = berval->bv_len; len = berval->bv_len;
memcpy( val, berval->bv_val, len ); memcpy( val, berval->bv_val, len );
WLDAP32_ber_bvfree( berval ); WLDAP32_ber_bvfree( berval );
if (!(ctrl = heap_alloc( sizeof(*ctrl) ))) if (!(ctrl = malloc( sizeof(*ctrl) )))
{ {
heap_free( val ); free( val );
return WLDAP32_LDAP_NO_MEMORY; return WLDAP32_LDAP_NO_MEMORY;
} }
if (!(ctrl->ldctl_oid = strAtoW( LDAP_PAGED_RESULT_OID_STRING ))) if (!(ctrl->ldctl_oid = strAtoW( LDAP_PAGED_RESULT_OID_STRING )))
{ {
heap_free( ctrl ); free( ctrl );
return WLDAP32_LDAP_NO_MEMORY; return WLDAP32_LDAP_NO_MEMORY;
} }
ctrl->ldctl_value.bv_len = len; ctrl->ldctl_value.bv_len = len;
...@@ -196,7 +196,7 @@ ULONG CDECL ldap_get_paged_count( WLDAP32_LDAP *ld, LDAPSearch *search, ULONG *c ...@@ -196,7 +196,7 @@ ULONG CDECL ldap_get_paged_count( WLDAP32_LDAP *ld, LDAPSearch *search, ULONG *c
return WLDAP32_LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
} }
heap_free( search->cookie ); free( search->cookie );
search->cookie = NULL; search->cookie = NULL;
ret = ldap_parse_page_controlW( ld, server_ctrls, count, &search->cookie ); ret = ldap_parse_page_controlW( ld, server_ctrls, count, &search->cookie );
...@@ -272,17 +272,17 @@ ULONG CDECL ldap_search_abandon_page( WLDAP32_LDAP *ld, LDAPSearch *search ) ...@@ -272,17 +272,17 @@ ULONG CDECL ldap_search_abandon_page( WLDAP32_LDAP *ld, LDAPSearch *search )
if (!ld || !search) return ~0u; if (!ld || !search) return ~0u;
strfreeW( search->dn ); free( search->dn );
strfreeW( search->filter ); free( search->filter );
strarrayfreeW( search->attrs ); strarrayfreeW( search->attrs );
ctrls = search->serverctrls; ctrls = search->serverctrls;
controlfreeW( ctrls[0] ); /* page control */ controlfreeW( ctrls[0] ); /* page control */
ctrls++; ctrls++;
while (*ctrls) controlfreeW( *ctrls++ ); while (*ctrls) controlfreeW( *ctrls++ );
heap_free( search->serverctrls ); free( search->serverctrls );
controlarrayfreeW( search->clientctrls ); controlarrayfreeW( search->clientctrls );
if (search->cookie && search->cookie != &null_cookieW) heap_free( search->cookie ); if (search->cookie && search->cookie != &null_cookieW) free( search->cookie );
heap_free( search ); free( search );
return WLDAP32_LDAP_SUCCESS; return WLDAP32_LDAP_SUCCESS;
} }
...@@ -306,7 +306,7 @@ LDAPSearch * CDECL ldap_search_init_pageW( WLDAP32_LDAP *ld, WCHAR *dn, ULONG sc ...@@ -306,7 +306,7 @@ LDAPSearch * CDECL ldap_search_init_pageW( WLDAP32_LDAP *ld, WCHAR *dn, ULONG sc
TRACE( "(%p, %s, 0x%08x, %s, %p, 0x%08x, %p, %p, 0x%08x, 0x%08x, %p)\n", ld, debugstr_w(dn), scope, TRACE( "(%p, %s, 0x%08x, %s, %p, 0x%08x, %p, %p, 0x%08x, 0x%08x, %p)\n", ld, debugstr_w(dn), scope,
debugstr_w(filter), attrs, attrsonly, serverctrls, clientctrls, timelimit, sizelimit, sortkeys ); debugstr_w(filter), attrs, attrsonly, serverctrls, clientctrls, timelimit, sizelimit, sortkeys );
if (!(search = heap_alloc_zero( sizeof(*search) ))) if (!(search = calloc( 1, sizeof(*search) )))
{ {
ld->ld_errno = WLDAP32_LDAP_NO_MEMORY; ld->ld_errno = WLDAP32_LDAP_NO_MEMORY;
return NULL; return NULL;
...@@ -317,7 +317,7 @@ LDAPSearch * CDECL ldap_search_init_pageW( WLDAP32_LDAP *ld, WCHAR *dn, ULONG sc ...@@ -317,7 +317,7 @@ LDAPSearch * CDECL ldap_search_init_pageW( WLDAP32_LDAP *ld, WCHAR *dn, ULONG sc
if (attrs && !(search->attrs = strarraydupW( attrs ))) goto fail; if (attrs && !(search->attrs = strarraydupW( attrs ))) goto fail;
len = serverctrls ? controlarraylenW( serverctrls ) : 0; len = serverctrls ? controlarraylenW( serverctrls ) : 0;
if (!(search->serverctrls = heap_alloc( sizeof(LDAPControlW *) * (len + 2) ))) goto fail; if (!(search->serverctrls = malloc( sizeof(LDAPControlW *) * (len + 2) ))) goto fail;
search->serverctrls[0] = NULL; /* reserve 0 for page control */ search->serverctrls[0] = NULL; /* reserve 0 for page control */
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
......
...@@ -54,9 +54,9 @@ ULONG CDECL ldap_rename_extA( WLDAP32_LDAP *ld, char *dn, char *newrdn, char *ne ...@@ -54,9 +54,9 @@ ULONG CDECL ldap_rename_extA( WLDAP32_LDAP *ld, char *dn, char *newrdn, char *ne
ret = ldap_rename_extW( ld, dnW, newrdnW, newparentW, delete, serverctrlsW, clientctrlsW, message ); ret = ldap_rename_extW( ld, dnW, newrdnW, newparentW, delete, serverctrlsW, clientctrlsW, message );
exit: exit:
strfreeW( dnW ); free( dnW );
strfreeW( newrdnW ); free( newrdnW );
strfreeW( newparentW ); free( newparentW );
controlarrayfreeW( serverctrlsW ); controlarrayfreeW( serverctrlsW );
controlarrayfreeW( clientctrlsW ); controlarrayfreeW( clientctrlsW );
return ret; return ret;
...@@ -107,9 +107,9 @@ ULONG CDECL ldap_rename_extW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newrdn, WCHAR ...@@ -107,9 +107,9 @@ ULONG CDECL ldap_rename_extW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newrdn, WCHAR
ret = map_error( ldap_funcs->ldap_rename( ld->ld, dnU, newrdnU, newparentU, delete, serverctrlsU, clientctrlsU, ret = map_error( ldap_funcs->ldap_rename( ld->ld, dnU, newrdnU, newparentU, delete, serverctrlsU, clientctrlsU,
message ) ); message ) );
exit: exit:
strfreeU( dnU ); free( dnU );
strfreeU( newrdnU ); free( newrdnU );
strfreeU( newparentU ); free( newparentU );
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
controlarrayfreeU( clientctrlsU ); controlarrayfreeU( clientctrlsU );
return ret; return ret;
...@@ -141,9 +141,9 @@ ULONG CDECL ldap_rename_ext_sA( WLDAP32_LDAP *ld, char *dn, char *newrdn, char * ...@@ -141,9 +141,9 @@ ULONG CDECL ldap_rename_ext_sA( WLDAP32_LDAP *ld, char *dn, char *newrdn, char *
ret = ldap_rename_ext_sW( ld, dnW, newrdnW, newparentW, delete, serverctrlsW, clientctrlsW ); ret = ldap_rename_ext_sW( ld, dnW, newrdnW, newparentW, delete, serverctrlsW, clientctrlsW );
exit: exit:
strfreeW( dnW ); free( dnW );
strfreeW( newrdnW ); free( newrdnW );
strfreeW( newparentW ); free( newparentW );
controlarrayfreeW( serverctrlsW ); controlarrayfreeW( serverctrlsW );
controlarrayfreeW( clientctrlsW ); controlarrayfreeW( clientctrlsW );
return ret; return ret;
...@@ -187,9 +187,9 @@ ULONG CDECL ldap_rename_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newrdn, WCHA ...@@ -187,9 +187,9 @@ ULONG CDECL ldap_rename_ext_sW( WLDAP32_LDAP *ld, WCHAR *dn, WCHAR *newrdn, WCHA
ret = map_error( ldap_funcs->ldap_rename_s( ld->ld, dnU, newrdnU, newparentU, delete, serverctrlsU, ret = map_error( ldap_funcs->ldap_rename_s( ld->ld, dnU, newrdnU, newparentU, delete, serverctrlsU,
clientctrlsU ) ); clientctrlsU ) );
exit: exit:
strfreeU( dnU ); free( dnU );
strfreeU( newrdnU ); free( newrdnU );
strfreeU( newparentU ); free( newparentU );
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
controlarrayfreeU( clientctrlsU ); controlarrayfreeU( clientctrlsU );
return ret; return ret;
......
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
*/ */
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h>
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winnls.h" #include "winnls.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h"
#include "winldap_private.h" #include "winldap_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32); WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
...@@ -50,8 +50,8 @@ ULONG CDECL ldap_searchA( WLDAP32_LDAP *ld, char *base, ULONG scope, char *filte ...@@ -50,8 +50,8 @@ ULONG CDECL ldap_searchA( WLDAP32_LDAP *ld, char *base, ULONG scope, char *filte
ret = ldap_searchW( ld, baseW, scope, filterW, attrsW, attrsonly ); ret = ldap_searchW( ld, baseW, scope, filterW, attrsW, attrsonly );
exit: exit:
strfreeW( baseW ); free( baseW );
strfreeW( filterW ); free( filterW );
strarrayfreeW( attrsW ); strarrayfreeW( attrsW );
return ret; return ret;
} }
...@@ -116,8 +116,8 @@ ULONG CDECL ldap_search_extA( WLDAP32_LDAP *ld, char *base, ULONG scope, char *f ...@@ -116,8 +116,8 @@ ULONG CDECL ldap_search_extA( WLDAP32_LDAP *ld, char *base, ULONG scope, char *f
sizelimit, message ); sizelimit, message );
exit: exit:
strfreeW( baseW ); free( baseW );
strfreeW( filterW ); free( filterW );
strarrayfreeW( attrsW ); strarrayfreeW( attrsW );
controlarrayfreeW( serverctrlsW ); controlarrayfreeW( serverctrlsW );
controlarrayfreeW( clientctrlsW ); controlarrayfreeW( clientctrlsW );
...@@ -179,8 +179,8 @@ ULONG CDECL ldap_search_extW( WLDAP32_LDAP *ld, WCHAR *base, ULONG scope, WCHAR ...@@ -179,8 +179,8 @@ ULONG CDECL ldap_search_extW( WLDAP32_LDAP *ld, WCHAR *base, ULONG scope, WCHAR
serverctrlsU, clientctrlsU, timelimit ? &timevalU : NULL, sizelimit, serverctrlsU, clientctrlsU, timelimit ? &timevalU : NULL, sizelimit,
message ) ); message ) );
exit: exit:
strfreeU( baseU ); free( baseU );
strfreeU( filterU ); free( filterU );
strarrayfreeU( attrsU ); strarrayfreeU( attrsU );
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
controlarrayfreeU( clientctrlsU ); controlarrayfreeU( clientctrlsU );
...@@ -215,8 +215,8 @@ ULONG CDECL ldap_search_ext_sA( WLDAP32_LDAP *ld, char *base, ULONG scope, char ...@@ -215,8 +215,8 @@ ULONG CDECL ldap_search_ext_sA( WLDAP32_LDAP *ld, char *base, ULONG scope, char
sizelimit, res ); sizelimit, res );
exit: exit:
strfreeW( baseW ); free( baseW );
strfreeW( filterW ); free( filterW );
strarrayfreeW( attrsW ); strarrayfreeW( attrsW );
controlarrayfreeW( serverctrlsW ); controlarrayfreeW( serverctrlsW );
controlarrayfreeW( clientctrlsW ); controlarrayfreeW( clientctrlsW );
...@@ -280,7 +280,7 @@ ULONG CDECL ldap_search_ext_sW( WLDAP32_LDAP *ld, WCHAR *base, ULONG scope, WCHA ...@@ -280,7 +280,7 @@ ULONG CDECL ldap_search_ext_sW( WLDAP32_LDAP *ld, WCHAR *base, ULONG scope, WCHA
clientctrlsU, timeout ? &timevalU : NULL, sizelimit, &msgU ) ); clientctrlsU, timeout ? &timevalU : NULL, sizelimit, &msgU ) );
if (msgU) if (msgU)
{ {
WLDAP32_LDAPMessage *msg = heap_alloc_zero( sizeof(*msg) ); WLDAP32_LDAPMessage *msg = calloc( 1, sizeof(*msg) );
if (msg) if (msg)
{ {
msg->Request = msgU; msg->Request = msgU;
...@@ -294,8 +294,8 @@ ULONG CDECL ldap_search_ext_sW( WLDAP32_LDAP *ld, WCHAR *base, ULONG scope, WCHA ...@@ -294,8 +294,8 @@ ULONG CDECL ldap_search_ext_sW( WLDAP32_LDAP *ld, WCHAR *base, ULONG scope, WCHA
} }
exit: exit:
strfreeU( baseU ); free( baseU );
strfreeU( filterU ); free( filterU );
strarrayfreeU( attrsU ); strarrayfreeU( attrsU );
controlarrayfreeU( serverctrlsU ); controlarrayfreeU( serverctrlsU );
controlarrayfreeU( clientctrlsU ); controlarrayfreeU( clientctrlsU );
...@@ -325,8 +325,8 @@ ULONG CDECL ldap_search_sA( WLDAP32_LDAP *ld, char *base, ULONG scope, char *fil ...@@ -325,8 +325,8 @@ ULONG CDECL ldap_search_sA( WLDAP32_LDAP *ld, char *base, ULONG scope, char *fil
ret = ldap_search_sW( ld, baseW, scope, filterW, attrsW, attrsonly, res ); ret = ldap_search_sW( ld, baseW, scope, filterW, attrsW, attrsonly, res );
exit: exit:
strfreeW( baseW ); free( baseW );
strfreeW( filterW ); free( filterW );
strarrayfreeW( attrsW ); strarrayfreeW( attrsW );
return ret; return ret;
} }
...@@ -384,8 +384,8 @@ ULONG CDECL ldap_search_stA( WLDAP32_LDAP *ld, const PCHAR base, ULONG scope, co ...@@ -384,8 +384,8 @@ ULONG CDECL ldap_search_stA( WLDAP32_LDAP *ld, const PCHAR base, ULONG scope, co
ret = ldap_search_stW( ld, baseW, scope, filterW, attrsW, attrsonly, timeout, res ); ret = ldap_search_stW( ld, baseW, scope, filterW, attrsW, attrsonly, timeout, res );
exit: exit:
strfreeW( baseW ); free( baseW );
strfreeW( filterW ); free( filterW );
strarrayfreeW( attrsW ); strarrayfreeW( attrsW );
return ret; return ret;
} }
......
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
*/ */
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h>
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "winnls.h" #include "winnls.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/heap.h"
#include "winldap_private.h" #include "winldap_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(wldap32); WINE_DEFAULT_DEBUG_CHANNEL(wldap32);
...@@ -120,7 +120,7 @@ char ** CDECL ldap_get_valuesA( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, ch ...@@ -120,7 +120,7 @@ char ** CDECL ldap_get_valuesA( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, ch
ret = strarrayWtoA( retW ); ret = strarrayWtoA( retW );
ldap_value_freeW( retW ); ldap_value_freeW( retW );
strfreeW( attrW ); free( attrW );
return ret; return ret;
} }
...@@ -129,7 +129,7 @@ static char *bv2str( struct bervalU *bv ) ...@@ -129,7 +129,7 @@ static char *bv2str( struct bervalU *bv )
char *str = NULL; char *str = NULL;
unsigned int len = bv->bv_len; unsigned int len = bv->bv_len;
if ((str = heap_alloc( len + 1 ))) if ((str = malloc( len + 1 )))
{ {
memcpy( str, bv->bv_val, len ); memcpy( str, bv->bv_val, len );
str[len] = '\0'; str[len] = '\0';
...@@ -148,7 +148,7 @@ static char **bv2str_array( struct bervalU **bv ) ...@@ -148,7 +148,7 @@ static char **bv2str_array( struct bervalU **bv )
len++; len++;
p++; p++;
} }
if (!(str = heap_alloc( (len + 1) * sizeof(char *) ))) return NULL; if (!(str = malloc( (len + 1) * sizeof(char *) ))) return NULL;
p = bv; p = bv;
while (*p) while (*p)
...@@ -156,8 +156,8 @@ static char **bv2str_array( struct bervalU **bv ) ...@@ -156,8 +156,8 @@ static char **bv2str_array( struct bervalU **bv )
str[i] = bv2str( *p ); str[i] = bv2str( *p );
if (!str[i]) if (!str[i])
{ {
while (i > 0) heap_free( str[--i] ); while (i > 0) free( str[--i] );
heap_free( str ); free( str );
return NULL; return NULL;
} }
i++; i++;
...@@ -205,7 +205,7 @@ WCHAR ** CDECL ldap_get_valuesW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, W ...@@ -205,7 +205,7 @@ WCHAR ** CDECL ldap_get_valuesW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, W
strarrayfreeU( retU ); strarrayfreeU( retU );
} }
strfreeU( attrU ); free( attrU );
return ret; return ret;
} }
...@@ -225,7 +225,7 @@ struct WLDAP32_berval ** CDECL ldap_get_values_lenA( WLDAP32_LDAP *ld, WLDAP32_L ...@@ -225,7 +225,7 @@ struct WLDAP32_berval ** CDECL ldap_get_values_lenA( WLDAP32_LDAP *ld, WLDAP32_L
ret = ldap_get_values_lenW( ld, message, attrW ); ret = ldap_get_values_lenW( ld, message, attrW );
strfreeW( attrW ); free( attrW );
return ret; return ret;
} }
...@@ -264,7 +264,7 @@ struct WLDAP32_berval ** CDECL ldap_get_values_lenW( WLDAP32_LDAP *ld, WLDAP32_L ...@@ -264,7 +264,7 @@ struct WLDAP32_berval ** CDECL ldap_get_values_lenW( WLDAP32_LDAP *ld, WLDAP32_L
bvarrayfreeU( retU ); bvarrayfreeU( retU );
} }
strfreeU( attrU ); free( attrU );
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment