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
64d9d63f
Commit
64d9d63f
authored
Aug 16, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Aug 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adsldp: Use CRT allocation functions.
parent
7abcc312
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
16 deletions
+11
-16
adsldp_private.h
dlls/adsldp/adsldp_private.h
+1
-3
schema.c
dlls/adsldp/schema.c
+10
-13
No files found.
dlls/adsldp/adsldp_private.h
View file @
64d9d63f
...
...
@@ -19,8 +19,6 @@
#ifndef _ADSLDP_PRIVATE_H
#define _ADSLDP_PRIVATE_H
#include "wine/heap.h"
static
inline
LPWSTR
strnUtoW
(
LPCSTR
str
,
DWORD
inlen
,
DWORD
*
outlen
)
{
LPWSTR
ret
=
NULL
;
...
...
@@ -28,7 +26,7 @@ static inline LPWSTR strnUtoW( LPCSTR str, DWORD inlen, DWORD *outlen )
if
(
str
)
{
DWORD
len
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
str
,
inlen
,
NULL
,
0
);
if
((
ret
=
heap_
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
if
((
ret
=
m
alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
)))
{
MultiByteToWideChar
(
CP_UTF8
,
0
,
str
,
inlen
,
ret
,
len
);
ret
[
len
]
=
0
;
...
...
dlls/adsldp/schema.c
View file @
64d9d63f
...
...
@@ -116,9 +116,9 @@ ADSTYPEENUM get_schema_type(const WCHAR *name, const struct attribute_type *at,
static
void
free_attribute_type
(
struct
attribute_type
*
at
)
{
heap_
free
(
at
->
oid
);
heap_
free
(
at
->
name
);
heap_
free
(
at
->
syntax
);
free
(
at
->
oid
);
free
(
at
->
name
);
free
(
at
->
syntax
);
}
void
free_attribute_types
(
struct
attribute_type
*
at
,
ULONG
count
)
...
...
@@ -128,7 +128,7 @@ void free_attribute_types(struct attribute_type *at, ULONG count)
for
(
i
=
0
;
i
<
count
;
i
++
)
free_attribute_type
(
&
at
[
i
]);
heap_
free
(
at
);
free
(
at
);
}
static
BOOL
is_space
(
WCHAR
c
)
...
...
@@ -156,7 +156,7 @@ static WCHAR *parse_oid(WCHAR **str)
}
count
=
end
-
p
;
oid
=
heap_
alloc
((
count
+
1
)
*
sizeof
(
WCHAR
));
oid
=
m
alloc
((
count
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
oid
)
return
NULL
;
memcpy
(
oid
,
p
,
count
*
sizeof
(
WCHAR
));
...
...
@@ -202,17 +202,14 @@ static WCHAR *parse_name(WCHAR **str, ULONG *name_count)
count
=
wcslen
(
tmp_name
);
if
(
!
name
)
new_name
=
heap_alloc
((
count
+
1
)
*
sizeof
(
WCHAR
));
else
new_name
=
heap_realloc
(
name
,
(
total_count
+
count
+
1
)
*
sizeof
(
WCHAR
));
new_name
=
realloc
(
name
,
(
total_count
+
count
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
new_name
)
break
;
memcpy
(
new_name
+
total_count
,
tmp_name
,
(
count
+
1
)
*
sizeof
(
WCHAR
));
name
=
new_name
;
heap_
free
(
tmp_name
);
free
(
tmp_name
);
total_count
+=
count
+
1
;
*
name_count
+=
1
;
...
...
@@ -221,7 +218,7 @@ static WCHAR *parse_name(WCHAR **str, ULONG *name_count)
*
str
=
*
p
?
p
+
1
:
p
;
heap_
free
(
name
);
free
(
name
);
return
NULL
;
}
...
...
@@ -236,7 +233,7 @@ static WCHAR *parse_name(WCHAR **str, ULONG *name_count)
if
(
!
end
)
return
NULL
;
count
=
end
-
p
;
name
=
heap_
alloc
((
count
+
1
)
*
sizeof
(
WCHAR
));
name
=
m
alloc
((
count
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
name
)
return
NULL
;
memcpy
(
name
,
p
,
count
*
sizeof
(
WCHAR
));
...
...
@@ -400,7 +397,7 @@ struct attribute_type *load_schema(LDAP *ld, ULONG *at_single_count, ULONG *at_m
{
ULONG
i
,
total
=
ldap_count_valuesW
(
types
);
at
=
heap_
alloc
(
total
*
sizeof
(
*
at
));
at
=
m
alloc
(
total
*
sizeof
(
*
at
));
if
(
!
at
)
goto
exit
;
for
(
i
=
0
;
i
<
total
;
i
++
)
...
...
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