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
3c160444
Commit
3c160444
authored
May 30, 2014
by
Bruno Jesus
Committed by
Alexandre Julliard
Jun 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Fix a memory leak in _ItemizeInternal (valgrind).
parent
9dacce1b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
usp10.c
dlls/usp10/usp10.c
+8
-12
No files found.
dlls/usp10/usp10.c
View file @
3c160444
...
@@ -1280,6 +1280,7 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
...
@@ -1280,6 +1280,7 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
WORD
layoutRTL
=
0
;
WORD
layoutRTL
=
0
;
BOOL
forceLevels
=
FALSE
;
BOOL
forceLevels
=
FALSE
;
INT
consumed
=
0
;
INT
consumed
=
0
;
HRESULT
res
=
E_OUTOFMEMORY
;
TRACE
(
"%s,%d,%d,%p,%p,%p,%p
\n
"
,
debugstr_wn
(
pwcInChars
,
cInChars
),
cInChars
,
cMaxItems
,
TRACE
(
"%s,%d,%d,%p,%p,%p,%p
\n
"
,
debugstr_wn
(
pwcInChars
,
cInChars
),
cInChars
,
cMaxItems
,
psControl
,
psState
,
pItems
,
pcItems
);
psControl
,
psState
,
pItems
,
pcItems
);
...
@@ -1374,10 +1375,7 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
...
@@ -1374,10 +1375,7 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
{
{
levels
=
heap_alloc_zero
(
cInChars
*
sizeof
(
WORD
));
levels
=
heap_alloc_zero
(
cInChars
*
sizeof
(
WORD
));
if
(
!
levels
)
if
(
!
levels
)
{
goto
nomemory
;
heap_free
(
scripts
);
return
E_OUTOFMEMORY
;
}
BIDI_DetermineLevels
(
pwcInChars
,
cInChars
,
psState
,
psControl
,
levels
);
BIDI_DetermineLevels
(
pwcInChars
,
cInChars
,
psState
,
psControl
,
levels
);
baselevel
=
levels
[
0
];
baselevel
=
levels
[
0
];
...
@@ -1396,11 +1394,7 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
...
@@ -1396,11 +1394,7 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
strength
=
heap_alloc_zero
(
cInChars
*
sizeof
(
WORD
));
strength
=
heap_alloc_zero
(
cInChars
*
sizeof
(
WORD
));
if
(
!
strength
)
if
(
!
strength
)
{
goto
nomemory
;
heap_free
(
scripts
);
heap_free
(
levels
);
return
E_OUTOFMEMORY
;
}
BIDI_GetStrengths
(
pwcInChars
,
cInChars
,
psControl
,
strength
);
BIDI_GetStrengths
(
pwcInChars
,
cInChars
,
psControl
,
strength
);
/* We currently mis-level leading Diacriticals */
/* We currently mis-level leading Diacriticals */
...
@@ -1580,7 +1574,7 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
...
@@ -1580,7 +1574,7 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
index
++
;
index
++
;
if
(
index
+
1
>
cMaxItems
)
if
(
index
+
1
>
cMaxItems
)
return
E_OUTOFMEMORY
;
goto
nomemory
;
if
(
strength
)
if
(
strength
)
str
=
strength
[
cnt
];
str
=
strength
[
cnt
];
...
@@ -1616,7 +1610,7 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
...
@@ -1616,7 +1610,7 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
* item is set up to prevent random behaviour if the caller erroneously
* item is set up to prevent random behaviour if the caller erroneously
* checks the n+1 structure */
* checks the n+1 structure */
index
++
;
index
++
;
if
(
index
+
1
>
cMaxItems
)
return
E_OUTOFMEMORY
;
if
(
index
+
1
>
cMaxItems
)
goto
nomemory
;
memset
(
&
pItems
[
index
].
a
,
0
,
sizeof
(
SCRIPT_ANALYSIS
));
memset
(
&
pItems
[
index
].
a
,
0
,
sizeof
(
SCRIPT_ANALYSIS
));
TRACE
(
"index=%d cnt=%d iCharPos=%d
\n
"
,
index
,
cnt
,
pItems
[
index
].
iCharPos
);
TRACE
(
"index=%d cnt=%d iCharPos=%d
\n
"
,
index
,
cnt
,
pItems
[
index
].
iCharPos
);
...
@@ -1626,10 +1620,12 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
...
@@ -1626,10 +1620,12 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars,
/* Set SCRIPT_ITEM */
/* Set SCRIPT_ITEM */
pItems
[
index
].
iCharPos
=
cnt
;
/* the last item contains the ptr to the lastchar */
pItems
[
index
].
iCharPos
=
cnt
;
/* the last item contains the ptr to the lastchar */
res
=
S_OK
;
nomemory:
heap_free
(
levels
);
heap_free
(
levels
);
heap_free
(
strength
);
heap_free
(
strength
);
heap_free
(
scripts
);
heap_free
(
scripts
);
return
S_OK
;
return
res
;
}
}
/***********************************************************************
/***********************************************************************
...
...
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