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
a6f3e4ad
Commit
a6f3e4ad
authored
Feb 06, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Feb 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhlp32: Fix memory leak on realloc failure in HLPFILE_RtfAddBitmap (cppcheck).
parent
e1f45229
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
hlpfile.c
programs/winhlp32/hlpfile.c
+8
-2
No files found.
programs/winhlp32/hlpfile.c
View file @
a6f3e4ad
...
...
@@ -966,6 +966,7 @@ static BOOL HLPFILE_RtfAddBitmap(struct RtfData* rd, HLPFILE* file, const BYTE*
const
BYTE
*
pict_beg
;
BYTE
*
alloc
=
NULL
;
BITMAPINFO
*
bi
;
BITMAPINFO
*
new_bi
;
ULONG
off
,
csz
;
unsigned
nc
=
0
;
BOOL
clrImportant
=
FALSE
;
...
...
@@ -1013,8 +1014,13 @@ static BOOL HLPFILE_RtfAddBitmap(struct RtfData* rd, HLPFILE* file, const BYTE*
if
(
!
nc
&&
bi
->
bmiHeader
.
biBitCount
<=
8
)
nc
=
1
<<
bi
->
bmiHeader
.
biBitCount
;
bi
=
realloc
(
bi
,
sizeof
(
*
bi
)
+
nc
*
sizeof
(
RGBQUAD
));
if
(
!
bi
)
return
FALSE
;
new_bi
=
realloc
(
bi
,
sizeof
(
*
bi
)
+
nc
*
sizeof
(
RGBQUAD
));
if
(
!
new_bi
)
{
free
(
bi
);
return
FALSE
;
}
bi
=
new_bi
;
for
(
i
=
0
;
i
<
nc
;
i
++
)
{
bi
->
bmiColors
[
i
].
rgbBlue
=
ptr
[
0
];
...
...
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