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
2a7c4ea8
Commit
2a7c4ea8
authored
Jun 05, 2016
by
Theodore Dubois
Committed by
Alexandre Julliard
Jun 08, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/tests: Fix memory leaks.
Signed-off-by:
Theodore Dubois
<
tblodt@icloud.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fbbac885
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
assoc.c
dlls/shell32/tests/assoc.c
+9
-3
No files found.
dlls/shell32/tests/assoc.c
View file @
2a7c4ea8
...
...
@@ -104,7 +104,7 @@ static void getstring_test(LPCWSTR assocName, HKEY progIdKey, ASSOCSTR str, LPCW
{
IQueryAssociations
*
assoc
;
HRESULT
hr
;
WCHAR
*
buffer
;
WCHAR
*
buffer
=
NULL
;
DWORD
len
;
hr
=
CoCreateInstance
(
&
CLSID_QueryAssociations
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IQueryAssociations
,
(
void
*
)
&
assoc
);
...
...
@@ -115,8 +115,11 @@ static void getstring_test(LPCWSTR assocName, HKEY progIdKey, ASSOCSTR str, LPCW
hr
=
IQueryAssociations_GetString
(
assoc
,
ASSOCF_NONE
,
str
,
NULL
,
NULL
,
&
len
);
if
(
expected_string
)
{
ok_
(
__FILE__
,
line
)(
hr
==
S_FALSE
,
"GetString returned 0x%x, expected S_FALSE
\n
"
,
hr
);
if
(
hr
!=
S_FALSE
)
return
;
/* don't try to allocate memory */
if
(
hr
!=
S_FALSE
)
{
/* don't try to allocate memory using unitialized len */
IQueryAssociations_Release
(
assoc
);
return
;
}
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
ok_
(
__FILE__
,
line
)(
buffer
!=
NULL
,
"out of memory
\n
"
);
...
...
@@ -128,6 +131,9 @@ static void getstring_test(LPCWSTR assocName, HKEY progIdKey, ASSOCSTR str, LPCW
}
else
{
ok_
(
__FILE__
,
line
)(
FAILED
(
hr
),
"GetString returned 0x%x, expected failure
\n
"
,
hr
);
}
IQueryAssociations_Release
(
assoc
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
}
static
void
test_IQueryAssociations_GetString
(
void
)
...
...
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