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
c8897169
Commit
c8897169
authored
Apr 16, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fusion: Fix a number of leaks in assembly_create.
parent
a0bbf847
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
12 deletions
+24
-12
assembly.c
dlls/fusion/assembly.c
+24
-12
No files found.
dlls/fusion/assembly.c
View file @
c8897169
...
...
@@ -343,40 +343,52 @@ HRESULT assembly_create(ASSEMBLY **out, LPCWSTR file)
*
out
=
NULL
;
assembly
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
ASSEMBLY
));
assembly
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
ASSEMBLY
));
if
(
!
assembly
)
return
E_OUTOFMEMORY
;
ZeroMemory
(
assembly
,
sizeof
(
ASSEMBLY
));
assembly
->
path
=
strdupWtoA
(
file
);
if
(
!
assembly
->
path
)
return
E_OUTOFMEMORY
;
{
hr
=
E_OUTOFMEMORY
;
goto
failed
;
}
assembly
->
hfile
=
CreateFileW
(
file
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
!
assembly
->
hfile
)
return
HRESULT_FROM_WIN32
(
GetLastError
());
if
(
assembly
->
hfile
==
INVALID_HANDLE_VALUE
)
{
hr
=
HRESULT_FROM_WIN32
(
GetLastError
());
goto
failed
;
}
assembly
->
hmap
=
CreateFileMappingW
(
assembly
->
hfile
,
NULL
,
PAGE_READONLY
,
0
,
0
,
NULL
);
if
(
!
assembly
->
hmap
)
return
HRESULT_FROM_WIN32
(
GetLastError
());
{
hr
=
HRESULT_FROM_WIN32
(
GetLastError
());
goto
failed
;
}
assembly
->
data
=
MapViewOfFile
(
assembly
->
hmap
,
FILE_MAP_READ
,
0
,
0
,
0
);
if
(
!
assembly
->
data
)
return
HRESULT_FROM_WIN32
(
GetLastError
());
{
hr
=
HRESULT_FROM_WIN32
(
GetLastError
());
goto
failed
;
}
hr
=
parse_pe_header
(
assembly
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
FAILED
(
hr
))
goto
failed
;
hr
=
parse_clr_metadata
(
assembly
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
FAILED
(
hr
))
goto
failed
;
*
out
=
assembly
;
return
S_OK
;
failed:
assembly_release
(
assembly
);
return
hr
;
}
HRESULT
assembly_release
(
ASSEMBLY
*
assembly
)
...
...
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