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
6dc90620
Commit
6dc90620
authored
May 26, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Fix a couple of handle leaks.
parent
b79fde44
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
resource.c
dlls/kernel32/resource.c
+7
-15
No files found.
dlls/kernel32/resource.c
View file @
6dc90620
...
...
@@ -903,7 +903,6 @@ struct resource_size_info {
struct
mapping_info
{
HANDLE
file
;
HANDLE
mapping
;
void
*
base
;
DWORD
size
;
BOOL
read_write
;
...
...
@@ -1062,6 +1061,7 @@ static BOOL read_mapped_resources( QUEUEDUPDATES *updates, void *base, DWORD map
static
BOOL
map_file_into_memory
(
struct
mapping_info
*
mi
)
{
DWORD
page_attr
,
perm
;
HANDLE
mapping
;
if
(
mi
->
read_write
)
{
...
...
@@ -1074,15 +1074,13 @@ static BOOL map_file_into_memory( struct mapping_info *mi )
perm
=
FILE_MAP_READ
;
}
mi
->
mapping
=
CreateFileMappingW
(
mi
->
file
,
NULL
,
page_attr
,
0
,
0
,
NULL
);
if
(
!
mi
->
mapping
)
return
FALSE
;
mapping
=
CreateFileMappingW
(
mi
->
file
,
NULL
,
page_attr
,
0
,
0
,
NULL
);
if
(
!
mapping
)
return
FALSE
;
mi
->
base
=
MapViewOfFile
(
mi
->
mapping
,
perm
,
0
,
0
,
mi
->
size
);
if
(
!
mi
->
base
)
return
FALSE
;
mi
->
base
=
MapViewOfFile
(
mapping
,
perm
,
0
,
0
,
mi
->
size
);
CloseHandle
(
mapping
);
return
TRUE
;
return
mi
->
base
!=
NULL
;
}
static
BOOL
unmap_file_from_memory
(
struct
mapping_info
*
mi
)
...
...
@@ -1090,9 +1088,6 @@ static BOOL unmap_file_from_memory( struct mapping_info *mi )
if
(
mi
->
base
)
UnmapViewOfFile
(
mi
->
base
);
mi
->
base
=
NULL
;
if
(
mi
->
mapping
)
CloseHandle
(
mi
->
mapping
);
mi
->
mapping
=
NULL
;
return
TRUE
;
}
...
...
@@ -1126,10 +1121,7 @@ static struct mapping_info *create_mapping( LPCWSTR name, BOOL rw )
if
(
map_file_into_memory
(
mi
))
return
mi
;
}
unmap_file_from_memory
(
mi
);
HeapFree
(
GetProcessHeap
(),
0
,
mi
);
destroy_mapping
(
mi
);
return
NULL
;
}
...
...
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