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
eae5b071
Commit
eae5b071
authored
Dec 14, 2009
by
Rob Shearman
Committed by
Alexandre Julliard
Dec 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cabinet: Fix memory leaks on failure in FDICopy.
parent
c20868e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
fdi.c
dlls/cabinet/fdi.c
+4
-0
No files found.
dlls/cabinet/fdi.c
View file @
eae5b071
...
@@ -2519,6 +2519,7 @@ BOOL __cdecl FDICopy(
...
@@ -2519,6 +2519,7 @@ BOOL __cdecl FDICopy(
/* slight overestimation here to save CPU cycles in the developer's brain */
/* slight overestimation here to save CPU cycles in the developer's brain */
if
((
pathlen
+
filenamelen
+
3
)
>
MAX_PATH
)
{
if
((
pathlen
+
filenamelen
+
3
)
>
MAX_PATH
)
{
ERR
(
"MAX_PATH exceeded.
\n
"
);
ERR
(
"MAX_PATH exceeded.
\n
"
);
PFDI_FREE
(
hfdi
,
decomp_state
);
PFDI_INT
(
hfdi
)
->
perf
->
erfOper
=
FDIERROR_CABINET_NOT_FOUND
;
PFDI_INT
(
hfdi
)
->
perf
->
erfOper
=
FDIERROR_CABINET_NOT_FOUND
;
PFDI_INT
(
hfdi
)
->
perf
->
erfType
=
ERROR_FILE_NOT_FOUND
;
PFDI_INT
(
hfdi
)
->
perf
->
erfType
=
ERROR_FILE_NOT_FOUND
;
PFDI_INT
(
hfdi
)
->
perf
->
fError
=
TRUE
;
PFDI_INT
(
hfdi
)
->
perf
->
fError
=
TRUE
;
...
@@ -2540,6 +2541,7 @@ BOOL __cdecl FDICopy(
...
@@ -2540,6 +2541,7 @@ BOOL __cdecl FDICopy(
/* get a handle to the cabfile */
/* get a handle to the cabfile */
cabhf
=
PFDI_OPEN
(
hfdi
,
fullpath
,
_O_RDONLY
|
_O_BINARY
,
_S_IREAD
|
_S_IWRITE
);
cabhf
=
PFDI_OPEN
(
hfdi
,
fullpath
,
_O_RDONLY
|
_O_BINARY
,
_S_IREAD
|
_S_IWRITE
);
if
(
cabhf
==
-
1
)
{
if
(
cabhf
==
-
1
)
{
PFDI_FREE
(
hfdi
,
decomp_state
);
PFDI_INT
(
hfdi
)
->
perf
->
erfOper
=
FDIERROR_CABINET_NOT_FOUND
;
PFDI_INT
(
hfdi
)
->
perf
->
erfOper
=
FDIERROR_CABINET_NOT_FOUND
;
PFDI_INT
(
hfdi
)
->
perf
->
fError
=
TRUE
;
PFDI_INT
(
hfdi
)
->
perf
->
fError
=
TRUE
;
SetLastError
(
ERROR_FILE_NOT_FOUND
);
SetLastError
(
ERROR_FILE_NOT_FOUND
);
...
@@ -2548,6 +2550,7 @@ BOOL __cdecl FDICopy(
...
@@ -2548,6 +2550,7 @@ BOOL __cdecl FDICopy(
if
(
cabhf
==
0
)
{
if
(
cabhf
==
0
)
{
ERR
(
"PFDI_OPEN returned zero for %s.
\n
"
,
fullpath
);
ERR
(
"PFDI_OPEN returned zero for %s.
\n
"
,
fullpath
);
PFDI_FREE
(
hfdi
,
decomp_state
);
PFDI_INT
(
hfdi
)
->
perf
->
erfOper
=
FDIERROR_CABINET_NOT_FOUND
;
PFDI_INT
(
hfdi
)
->
perf
->
erfOper
=
FDIERROR_CABINET_NOT_FOUND
;
PFDI_INT
(
hfdi
)
->
perf
->
erfType
=
ERROR_FILE_NOT_FOUND
;
PFDI_INT
(
hfdi
)
->
perf
->
erfType
=
ERROR_FILE_NOT_FOUND
;
PFDI_INT
(
hfdi
)
->
perf
->
fError
=
TRUE
;
PFDI_INT
(
hfdi
)
->
perf
->
fError
=
TRUE
;
...
@@ -2558,6 +2561,7 @@ BOOL __cdecl FDICopy(
...
@@ -2558,6 +2561,7 @@ BOOL __cdecl FDICopy(
/* check if it's really a cabfile. Note that this doesn't implement the bug */
/* check if it's really a cabfile. Note that this doesn't implement the bug */
if
(
!
FDI_read_entries
(
hfdi
,
cabhf
,
&
fdici
,
&
(
CAB
(
mii
))))
{
if
(
!
FDI_read_entries
(
hfdi
,
cabhf
,
&
fdici
,
&
(
CAB
(
mii
))))
{
ERR
(
"FDIIsCabinet failed.
\n
"
);
ERR
(
"FDIIsCabinet failed.
\n
"
);
PFDI_FREE
(
hfdi
,
decomp_state
);
PFDI_CLOSE
(
hfdi
,
cabhf
);
PFDI_CLOSE
(
hfdi
,
cabhf
);
return
FALSE
;
return
FALSE
;
}
}
...
...
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