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
fb083f4f
Commit
fb083f4f
authored
Jun 20, 2023
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32/recinfo: Use CoTaskMem* allocations for the record data.
parent
d9d66570
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
recinfo.c
dlls/oleaut32/recinfo.c
+2
-4
variant.c
dlls/oleaut32/variant.c
+4
-3
No files found.
dlls/oleaut32/recinfo.c
View file @
fb083f4f
...
...
@@ -524,7 +524,7 @@ static PVOID WINAPI IRecordInfoImpl_RecordCreate(IRecordInfo *iface)
TRACE
(
"(%p)
\n
"
,
This
);
record
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
size
);
record
=
CoTaskMemAlloc
(
This
->
size
);
IRecordInfo_RecordInit
(
iface
,
record
);
TRACE
(
"created record at %p
\n
"
,
record
);
return
record
;
...
...
@@ -555,9 +555,7 @@ static HRESULT WINAPI IRecordInfoImpl_RecordDestroy(IRecordInfo *iface, PVOID pv
if
(
FAILED
(
hres
))
return
hres
;
if
(
!
HeapFree
(
GetProcessHeap
(),
0
,
pvRecord
))
return
E_INVALIDARG
;
CoTaskMemFree
(
pvRecord
);
return
S_OK
;
}
...
...
dlls/oleaut32/variant.c
View file @
fb083f4f
...
...
@@ -686,11 +686,12 @@ static HRESULT VARIANT_CopyIRecordInfo(VARIANT *dest, const VARIANT *src)
hr
=
IRecordInfo_GetSize
(
src_rec
->
pRecInfo
,
&
size
);
if
(
FAILED
(
hr
))
return
hr
;
/* This could look cleaner if only RecordCreate() was used, but native doesn't use it.
Memory should be allocated in a same way as RecordCreate() does, so RecordDestroy()
/* Windows does not use RecordCreate() here, memory should be allocated in compatible way so RecordDestroy()
could free it later. */
dest_rec
->
pvRecord
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
dest_rec
->
pvRecord
=
CoTaskMemAlloc
(
size
);
if
(
!
dest_rec
->
pvRecord
)
return
E_OUTOFMEMORY
;
if
(
size
)
memset
(
dest_rec
->
pvRecord
,
0
,
size
);
dest_rec
->
pRecInfo
=
src_rec
->
pRecInfo
;
IRecordInfo_AddRef
(
src_rec
->
pRecInfo
);
...
...
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