Commit b072bb49 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

wldap32: Use the strdup function instead of reimplementing it.

parent c6cdea71
......@@ -266,7 +266,7 @@ ULONG WINAPIV WLDAP32_ber_scanf( WLDAP32_BerElement *ber, char *fmt, ... )
{
char *str, **ptr = va_arg( list, char ** );
if ((ret = ber_scanf( BER(ber), new_fmt, &str )) == -1) break;
*ptr = strdupU( str );
*ptr = strdup( str );
ldap_memfree( str );
break;
}
......
......@@ -197,7 +197,7 @@ ULONG CDECL ldap_encode_sort_controlA( LDAP *ld, LDAPSortKeyA **sortkeys, LDAPCo
if ((result = ldap_create_sort_controlA( ld, sortkeys, critical, &control )) == WLDAP32_LDAP_SUCCESS)
{
ret->ldctl_oid = strdupU(control->ldctl_oid);
ret->ldctl_oid = strdup( control->ldctl_oid );
bv_val_dup( &control->ldctl_value, &ret->ldctl_value );
ret->ldctl_iscritical = control->ldctl_iscritical;
ldap_control_freeA( control );
......
......@@ -36,7 +36,7 @@ static char **split_hostnames( const char *hostnames )
char **res, *str, *p, *q;
unsigned int i = 0;
str = strdupU( hostnames );
str = strdup( hostnames );
if (!str) return NULL;
p = str;
......@@ -72,7 +72,7 @@ static char **split_hostnames( const char *hostnames )
if (isspace( *p ))
{
*p = '\0'; p++;
res[i] = strdupU( q );
res[i] = strdup( q );
if (!res[i]) goto oom;
i++;
......@@ -82,7 +82,7 @@ static char **split_hostnames( const char *hostnames )
}
else
{
res[i] = strdupU( q );
res[i] = strdup( q );
if (!res[i]) goto oom;
i++;
}
......
......@@ -534,14 +534,6 @@ struct WLDAP32_berval ** CDECL ldap_get_values_lenW( LDAP *, LDAPMessage *, WCHA
ULONG map_error( int ) DECLSPEC_HIDDEN;
static inline char *strdupU( const char *src )
{
char *dst;
if (!src) return NULL;
if ((dst = malloc( strlen( src ) + 1 ))) strcpy( dst, src );
return dst;
}
static inline char *strWtoU( const WCHAR *str )
{
char *ret = NULL;
......@@ -1314,7 +1306,7 @@ static inline char **strarrayUtoU( char **strarray )
{
char **p = strarray, **q = ret;
while (*p) *q++ = strdupU( *p++ );
while (*p) *q++ = strdup( *p++ );
*q = NULL;
}
}
......
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