Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b072bb49
Commit
b072bb49
authored
Nov 27, 2022
by
Alex Henrie
Committed by
Alexandre Julliard
Nov 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wldap32: Use the strdup function instead of reimplementing it.
parent
c6cdea71
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
14 deletions
+6
-14
ber.c
dlls/wldap32/ber.c
+1
-1
control.c
dlls/wldap32/control.c
+1
-1
init.c
dlls/wldap32/init.c
+3
-3
winldap_private.h
dlls/wldap32/winldap_private.h
+1
-9
No files found.
dlls/wldap32/ber.c
View file @
b072bb49
...
@@ -266,7 +266,7 @@ ULONG WINAPIV WLDAP32_ber_scanf( WLDAP32_BerElement *ber, char *fmt, ... )
...
@@ -266,7 +266,7 @@ ULONG WINAPIV WLDAP32_ber_scanf( WLDAP32_BerElement *ber, char *fmt, ... )
{
{
char
*
str
,
**
ptr
=
va_arg
(
list
,
char
**
);
char
*
str
,
**
ptr
=
va_arg
(
list
,
char
**
);
if
((
ret
=
ber_scanf
(
BER
(
ber
),
new_fmt
,
&
str
))
==
-
1
)
break
;
if
((
ret
=
ber_scanf
(
BER
(
ber
),
new_fmt
,
&
str
))
==
-
1
)
break
;
*
ptr
=
strdup
U
(
str
);
*
ptr
=
strdup
(
str
);
ldap_memfree
(
str
);
ldap_memfree
(
str
);
break
;
break
;
}
}
...
...
dlls/wldap32/control.c
View file @
b072bb49
...
@@ -197,7 +197,7 @@ ULONG CDECL ldap_encode_sort_controlA( LDAP *ld, LDAPSortKeyA **sortkeys, LDAPCo
...
@@ -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
)
if
((
result
=
ldap_create_sort_controlA
(
ld
,
sortkeys
,
critical
,
&
control
))
==
WLDAP32_LDAP_SUCCESS
)
{
{
ret
->
ldctl_oid
=
strdup
U
(
control
->
ldctl_oid
);
ret
->
ldctl_oid
=
strdup
(
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_freeA
(
control
);
ldap_control_freeA
(
control
);
...
...
dlls/wldap32/init.c
View file @
b072bb49
...
@@ -36,7 +36,7 @@ static char **split_hostnames( const char *hostnames )
...
@@ -36,7 +36,7 @@ static char **split_hostnames( const char *hostnames )
char
**
res
,
*
str
,
*
p
,
*
q
;
char
**
res
,
*
str
,
*
p
,
*
q
;
unsigned
int
i
=
0
;
unsigned
int
i
=
0
;
str
=
strdup
U
(
hostnames
);
str
=
strdup
(
hostnames
);
if
(
!
str
)
return
NULL
;
if
(
!
str
)
return
NULL
;
p
=
str
;
p
=
str
;
...
@@ -72,7 +72,7 @@ static char **split_hostnames( const char *hostnames )
...
@@ -72,7 +72,7 @@ static char **split_hostnames( const char *hostnames )
if
(
isspace
(
*
p
))
if
(
isspace
(
*
p
))
{
{
*
p
=
'\0'
;
p
++
;
*
p
=
'\0'
;
p
++
;
res
[
i
]
=
strdup
U
(
q
);
res
[
i
]
=
strdup
(
q
);
if
(
!
res
[
i
])
goto
oom
;
if
(
!
res
[
i
])
goto
oom
;
i
++
;
i
++
;
...
@@ -82,7 +82,7 @@ static char **split_hostnames( const char *hostnames )
...
@@ -82,7 +82,7 @@ static char **split_hostnames( const char *hostnames )
}
}
else
else
{
{
res
[
i
]
=
strdup
U
(
q
);
res
[
i
]
=
strdup
(
q
);
if
(
!
res
[
i
])
goto
oom
;
if
(
!
res
[
i
])
goto
oom
;
i
++
;
i
++
;
}
}
...
...
dlls/wldap32/winldap_private.h
View file @
b072bb49
...
@@ -534,14 +534,6 @@ struct WLDAP32_berval ** CDECL ldap_get_values_lenW( LDAP *, LDAPMessage *, WCHA
...
@@ -534,14 +534,6 @@ struct WLDAP32_berval ** CDECL ldap_get_values_lenW( LDAP *, LDAPMessage *, WCHA
ULONG
map_error
(
int
)
DECLSPEC_HIDDEN
;
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
)
static
inline
char
*
strWtoU
(
const
WCHAR
*
str
)
{
{
char
*
ret
=
NULL
;
char
*
ret
=
NULL
;
...
@@ -1314,7 +1306,7 @@ static inline char **strarrayUtoU( char **strarray )
...
@@ -1314,7 +1306,7 @@ static inline char **strarrayUtoU( char **strarray )
{
{
char
**
p
=
strarray
,
**
q
=
ret
;
char
**
p
=
strarray
,
**
q
=
ret
;
while
(
*
p
)
*
q
++
=
strdup
U
(
*
p
++
);
while
(
*
p
)
*
q
++
=
strdup
(
*
p
++
);
*
q
=
NULL
;
*
q
=
NULL
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment