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
b312d420
Commit
b312d420
authored
Jul 02, 2008
by
Alexander Dorofeyev
Committed by
Alexandre Julliard
Jul 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Fix memory leak and behavior on errors in FilterMapper_EnumMatchingFilters.
parent
bbd22ae0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
filtermapper.c
dlls/quartz/filtermapper.c
+8
-10
No files found.
dlls/quartz/filtermapper.c
View file @
b312d420
...
...
@@ -1210,6 +1210,8 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters(
OutputType
[
0
]
=
clsOutMaj
;
OutputType
[
1
]
=
clsOutSub
;
*
ppEnum
=
NULL
;
hr
=
IFilterMapper2_EnumMatchingFilters
((
IFilterMapper2
*
)
This
,
&
ppEnumMoniker
,
0
,
...
...
@@ -1236,7 +1238,6 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters(
nb_mon
++
;
}
*
ppEnum
=
NULL
;
if
(
!
nb_mon
)
{
IEnumMoniker_Release
(
ppEnumMoniker
);
...
...
@@ -1249,6 +1250,7 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters(
IEnumMoniker_Release
(
ppEnumMoniker
);
return
E_OUTOFMEMORY
;
}
ZeroMemory
(
regfilters
,
nb_mon
*
sizeof
(
REGFILTER
));
/* will prevent bad free of Name in case of error. */
IEnumMoniker_Reset
(
ppEnumMoniker
);
while
(
IEnumMoniker_Next
(
ppEnumMoniker
,
1
,
&
IMon
,
&
nb
)
==
S_OK
)
...
...
@@ -1281,7 +1283,7 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters(
hr
=
E_OUTOFMEMORY
;
}
if
(
SUCCEEDED
(
hrSub
))
if
(
SUCCEEDED
(
hrSub
)
&&
regfilters
[
idx
].
Name
)
{
memcpy
(
regfilters
[
idx
].
Name
,
V_UNION
(
&
var
,
bstrVal
),
len
);
regfilters
[
idx
].
Clsid
=
clsid
;
...
...
@@ -1294,17 +1296,13 @@ static HRESULT WINAPI FilterMapper_EnumMatchingFilters(
VariantClear
(
&
var
);
}
/* In case of release all resources */
if
(
!
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
{
for
(
idx
=
0
;
idx
<
nb_mon
;
idx
++
)
CoTaskMemFree
(
regfilters
[
idx
].
Name
);
CoTaskMemFree
(
regfilters
);
IEnumMoniker_Release
(
ppEnumMoniker
);
return
hr
;
hr
=
IEnumRegFiltersImpl_Construct
(
regfilters
,
nb_mon
,
ppEnum
);
}
hr
=
IEnumRegFiltersImpl_Construct
(
regfilters
,
nb_mon
,
ppEnum
);
for
(
idx
=
0
;
idx
<
nb_mon
;
idx
++
)
CoTaskMemFree
(
regfilters
[
idx
].
Name
);
CoTaskMemFree
(
regfilters
);
IEnumMoniker_Release
(
ppEnumMoniker
);
...
...
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