Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1afa20ae
Commit
1afa20ae
authored
Dec 11, 2022
by
Alex Henrie
Committed by
Alexandre Julliard
Jan 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inetcomm: Fix memory leak on realloc failure in copy_headers_to_buf (cppcheck).
parent
02d4647c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
mimeole.c
dlls/inetcomm/mimeole.c
+5
-9
No files found.
dlls/inetcomm/mimeole.c
View file @
1afa20ae
...
@@ -485,7 +485,7 @@ static inline propschema *impl_from_IMimePropertySchema(IMimePropertySchema *ifa
...
@@ -485,7 +485,7 @@ static inline propschema *impl_from_IMimePropertySchema(IMimePropertySchema *ifa
*/
*/
static
HRESULT
copy_headers_to_buf
(
IStream
*
stm
,
char
**
ptr
)
static
HRESULT
copy_headers_to_buf
(
IStream
*
stm
,
char
**
ptr
)
{
{
char
*
buf
=
NULL
;
char
*
buf
=
NULL
,
*
new_buf
;
DWORD
size
=
PARSER_BUF_SIZE
,
offset
=
0
,
last_end
=
0
;
DWORD
size
=
PARSER_BUF_SIZE
,
offset
=
0
,
last_end
=
0
;
HRESULT
hr
;
HRESULT
hr
;
BOOL
done
=
FALSE
;
BOOL
done
=
FALSE
;
...
@@ -497,18 +497,14 @@ static HRESULT copy_headers_to_buf(IStream *stm, char **ptr)
...
@@ -497,18 +497,14 @@ static HRESULT copy_headers_to_buf(IStream *stm, char **ptr)
char
*
end
;
char
*
end
;
DWORD
read
;
DWORD
read
;
if
(
!
buf
)
if
(
buf
)
size
*=
2
;
buf
=
malloc
(
size
+
1
);
new_buf
=
realloc
(
buf
,
size
+
1
);
else
if
(
!
new_buf
)
{
size
*=
2
;
buf
=
realloc
(
buf
,
size
+
1
);
}
if
(
!
buf
)
{
{
hr
=
E_OUTOFMEMORY
;
hr
=
E_OUTOFMEMORY
;
goto
fail
;
goto
fail
;
}
}
buf
=
new_buf
;
hr
=
IStream_Read
(
stm
,
buf
+
offset
,
size
-
offset
,
&
read
);
hr
=
IStream_Read
(
stm
,
buf
+
offset
,
size
-
offset
,
&
read
);
if
(
FAILED
(
hr
))
goto
fail
;
if
(
FAILED
(
hr
))
goto
fail
;
...
...
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