Commit 7f5a7189 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

wldap32: Use the wcsdup function instead of reimplementing it.

parent 5d1820c4
...@@ -215,7 +215,7 @@ ULONG CDECL ldap_encode_sort_controlW( LDAP *ld, LDAPSortKeyW **sortkeys, LDAPCo ...@@ -215,7 +215,7 @@ ULONG CDECL ldap_encode_sort_controlW( LDAP *ld, LDAPSortKeyW **sortkeys, LDAPCo
if ((result = ldap_create_sort_controlW( ld, sortkeys, critical, &control )) == WLDAP32_LDAP_SUCCESS) if ((result = ldap_create_sort_controlW( ld, sortkeys, critical, &control )) == WLDAP32_LDAP_SUCCESS)
{ {
ret->ldctl_oid = strdupW(control->ldctl_oid); ret->ldctl_oid = wcsdup( control->ldctl_oid );
bv_val_dup( &control->ldctl_value, &ret->ldctl_value ); bv_val_dup( &control->ldctl_value, &ret->ldctl_value );
ret->ldctl_iscritical = control->ldctl_iscritical; ret->ldctl_iscritical = control->ldctl_iscritical;
ldap_control_freeW( control ); ldap_control_freeW( control );
......
...@@ -297,8 +297,8 @@ LDAPSearch * CDECL ldap_search_init_pageW( LDAP *ld, WCHAR *dn, ULONG scope, WCH ...@@ -297,8 +297,8 @@ LDAPSearch * CDECL ldap_search_init_pageW( LDAP *ld, WCHAR *dn, ULONG scope, WCH
return NULL; return NULL;
} }
if (dn && !(search->dn = strdupW( dn ))) goto fail; if (dn && !(search->dn = wcsdup( dn ))) goto fail;
if (filter && !(search->filter = strdupW( filter ))) goto fail; if (filter && !(search->filter = wcsdup( filter ))) goto fail;
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;
......
...@@ -542,14 +542,6 @@ static inline char *strdupU( const char *src ) ...@@ -542,14 +542,6 @@ static inline char *strdupU( const char *src )
return dst; return dst;
} }
static inline WCHAR *strdupW( const WCHAR *src )
{
WCHAR *dst;
if (!src) return NULL;
if ((dst = malloc( (lstrlenW( src ) + 1) * sizeof(WCHAR) ))) lstrcpyW( dst, src );
return dst;
}
static inline char *strWtoU( const WCHAR *str ) static inline char *strWtoU( const WCHAR *str )
{ {
char *ret = NULL; char *ret = NULL;
...@@ -652,7 +644,7 @@ static inline WCHAR **strarraydupW( WCHAR **strarray ) ...@@ -652,7 +644,7 @@ static inline WCHAR **strarraydupW( WCHAR **strarray )
{ {
WCHAR **p = strarray, **q = ret; WCHAR **p = strarray, **q = ret;
while (*p) *q++ = strdupW( *p++ ); while (*p) *q++ = wcsdup( *p++ );
*q = NULL; *q = NULL;
} }
} }
...@@ -1225,7 +1217,7 @@ static inline LDAPControlW *controldupW( LDAPControlW *control ) ...@@ -1225,7 +1217,7 @@ static inline LDAPControlW *controldupW( LDAPControlW *control )
return NULL; return NULL;
} }
ret->ldctl_oid = strdupW( control->ldctl_oid ); ret->ldctl_oid = wcsdup( control->ldctl_oid );
ret->ldctl_value.bv_len = len; ret->ldctl_value.bv_len = len;
ret->ldctl_value.bv_val = val; ret->ldctl_value.bv_val = val;
ret->ldctl_iscritical = control->ldctl_iscritical; ret->ldctl_iscritical = control->ldctl_iscritical;
......
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