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
dddfd469
Commit
dddfd469
authored
Apr 13, 2016
by
Alex Henrie
Committed by
Alexandre Julliard
Apr 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Fix memory leaks in CompositeMonikerImpl_Construct.
Signed-off-by:
Alex Henrie
<
alexhenrie24@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b7f18395
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
compositemoniker.c
dlls/ole32/compositemoniker.c
+16
-4
No files found.
dlls/ole32/compositemoniker.c
View file @
dddfd469
...
...
@@ -1755,6 +1755,7 @@ CompositeMonikerImpl_Construct(IMoniker **ppMoniker, IMoniker *pmkFirst, IMonike
IMoniker
*
tempMk
;
HRESULT
res
;
CompositeMonikerImpl
*
This
;
int
i
;
This
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
This
));
...
...
@@ -1800,12 +1801,14 @@ CompositeMonikerImpl_Construct(IMoniker **ppMoniker, IMoniker *pmkFirst, IMonike
if
(
++
This
->
tabLastIndex
==
This
->
tabSize
){
LPVOID
tab_moniker
=
This
->
tabMoniker
;
IMoniker
**
tab_moniker
=
This
->
tabMoniker
;
This
->
tabSize
+=
BLOCK_TAB_SIZE
;
This
->
tabMoniker
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
tabMoniker
,
This
->
tabSize
*
sizeof
(
This
->
tabMoniker
[
0
]));
if
(
This
->
tabMoniker
==
NULL
){
for
(
i
=
0
;
i
<
This
->
tabLastIndex
;
i
++
)
IMoniker_Release
(
tab_moniker
[
i
]);
HeapFree
(
GetProcessHeap
(),
0
,
tab_moniker
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
E_OUTOFMEMORY
;
...
...
@@ -1848,18 +1851,25 @@ CompositeMonikerImpl_Construct(IMoniker **ppMoniker, IMoniker *pmkFirst, IMonike
IMoniker_Release
(
This
->
tabMoniker
[
This
->
tabLastIndex
-
1
]);
This
->
tabMoniker
[
This
->
tabLastIndex
-
1
]
=
tempMk
;
}
else
}
else
{
for
(
i
=
0
;
i
<
This
->
tabLastIndex
;
i
++
)
IMoniker_Release
(
This
->
tabMoniker
[
i
]);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
tabMoniker
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
res
;
}
/* resize tabMoniker if needed */
if
(
This
->
tabLastIndex
==
This
->
tabSize
){
LPVOID
tab_moniker
=
This
->
tabMoniker
;
IMoniker
**
tab_moniker
=
This
->
tabMoniker
;
This
->
tabSize
+=
BLOCK_TAB_SIZE
;
This
->
tabMoniker
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
tabMoniker
,
This
->
tabSize
*
sizeof
(
IMoniker
));
if
(
This
->
tabMoniker
==
NULL
){
for
(
i
=
0
;
i
<
This
->
tabLastIndex
;
i
++
)
IMoniker_Release
(
tab_moniker
[
i
]);
HeapFree
(
GetProcessHeap
(),
0
,
tab_moniker
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
E_OUTOFMEMORY
;
...
...
@@ -1896,13 +1906,15 @@ CompositeMonikerImpl_Construct(IMoniker **ppMoniker, IMoniker *pmkFirst, IMonike
}
if
(
This
->
tabLastIndex
==
This
->
tabSize
){
LPVOID
tab_moniker
=
This
->
tabMoniker
;
IMoniker
**
tab_moniker
=
This
->
tabMoniker
;
This
->
tabSize
+=
BLOCK_TAB_SIZE
;
This
->
tabMoniker
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
This
->
tabMoniker
,
This
->
tabSize
*
sizeof
(
This
->
tabMoniker
[
0
]));
if
(
This
->
tabMoniker
==
NULL
){
for
(
i
=
0
;
i
<
This
->
tabLastIndex
;
i
++
)
IMoniker_Release
(
tab_moniker
[
i
]);
HeapFree
(
GetProcessHeap
(),
0
,
tab_moniker
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
E_OUTOFMEMORY
;
...
...
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