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
c66d27c5
Commit
c66d27c5
authored
Jan 15, 2011
by
Andrew Nguyen
Committed by
Alexandre Julliard
Jan 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Fix some memory leaks in SetupDiGetINFClassA.
Spotted with Valgrind.
parent
a91fd8fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
devinst.c
dlls/setupapi/devinst.c
+21
-3
No files found.
dlls/setupapi/devinst.c
View file @
c66d27c5
...
...
@@ -3998,10 +3998,26 @@ BOOL WINAPI SetupDiGetINFClassA(PCSTR inf, LPGUID class_guid, PSTR class_name,
PWSTR
class_nameW
=
NULL
;
UNICODE_STRING
infW
;
if
(
inf
)
RtlCreateUnicodeStringFromAsciiz
(
&
infW
,
inf
);
else
infW
.
Buffer
=
NULL
;
if
(
inf
)
{
if
(
!
RtlCreateUnicodeStringFromAsciiz
(
&
infW
,
inf
))
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
FALSE
;
}
}
else
infW
.
Buffer
=
NULL
;
if
(
class_name
&&
size
)
class_nameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
WCHAR
));
{
if
(
!
(
class_nameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
*
sizeof
(
WCHAR
))))
{
RtlFreeUnicodeString
(
&
infW
);
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
FALSE
;
}
}
retval
=
SetupDiGetINFClassW
(
infW
.
Buffer
,
class_guid
,
class_nameW
,
size
,
&
required_sizeW
);
...
...
@@ -4015,6 +4031,8 @@ BOOL WINAPI SetupDiGetINFClassA(PCSTR inf, LPGUID class_guid, PSTR class_name,
else
if
(
required_size
)
*
required_size
=
required_sizeW
;
HeapFree
(
GetProcessHeap
(),
0
,
class_nameW
);
RtlFreeUnicodeString
(
&
infW
);
return
retval
;
}
...
...
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