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
21dd0467
Commit
21dd0467
authored
Dec 17, 2016
by
Lauri Kenttä
Committed by
Alexandre Julliard
Dec 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Fix memory leak in WCMD_reduce.
Signed-off-by:
Lauri Kenttä
<
lauri.kentta@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0ea8893e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
builtins.c
programs/cmd/builtins.c
+8
-10
No files found.
programs/cmd/builtins.c
View file @
21dd0467
...
...
@@ -3689,7 +3689,7 @@ static WCHAR WCMD_popoperator(OPSTACK **opstack) {
* Returns non-zero on error.
*/
static
int
WCMD_reduce
(
OPSTACK
**
opstack
,
VARSTACK
**
varstack
)
{
OPSTACK
*
thisop
;
WCHAR
thisop
;
int
var1
,
var2
;
int
rc
=
0
;
...
...
@@ -3699,13 +3699,12 @@ static int WCMD_reduce(OPSTACK **opstack, VARSTACK **varstack) {
}
/* Remove the top operator */
thisop
=
*
opstack
;
*
opstack
=
(
*
opstack
)
->
next
;
WINE_TRACE
(
"Reducing the stacks - processing operator %c
\n
"
,
thisop
->
op
);
thisop
=
WCMD_popoperator
(
opstack
);
WINE_TRACE
(
"Reducing the stacks - processing operator %c
\n
"
,
thisop
);
/* One variable operators */
var1
=
WCMD_popnumber
(
varstack
);
switch
(
thisop
->
op
)
{
switch
(
thisop
)
{
case
'!'
:
WCMD_pushnumber
(
NULL
,
!
var1
,
varstack
);
break
;
case
'~'
:
WCMD_pushnumber
(
NULL
,
~
var1
,
varstack
);
...
...
@@ -3721,7 +3720,7 @@ static int WCMD_reduce(OPSTACK **opstack, VARSTACK **varstack) {
WINE_TRACE
(
"No operands left for the reduce?
\n
"
);
return
WCMD_NOOPERAND
;
}
switch
(
thisop
->
op
)
{
switch
(
thisop
)
{
case
'!'
:
case
'~'
:
case
OP_POSITIVE
:
...
...
@@ -3792,11 +3791,11 @@ static int WCMD_reduce(OPSTACK **opstack, VARSTACK **varstack) {
/* Make the operand stack grow by pushing the assign operator plus the
operator to perform */
while
(
calcassignments
[
i
].
op
!=
' '
&&
calcassignments
[
i
].
calculatedop
!=
thisop
->
op
)
{
calcassignments
[
i
].
calculatedop
!=
thisop
)
{
i
++
;
}
if
(
calcassignments
[
i
].
calculatedop
==
' '
)
{
WINE_ERR
(
"Unexpected operator %c
\n
"
,
thisop
->
op
);
WINE_ERR
(
"Unexpected operator %c
\n
"
,
thisop
);
return
WCMD_NOOPERATOR
;
}
WCMD_pushoperator
(
'='
,
WCMD_getprecedence
(
'='
),
opstack
);
...
...
@@ -3820,10 +3819,9 @@ static int WCMD_reduce(OPSTACK **opstack, VARSTACK **varstack) {
break
;
}
default:
WINE_ERR
(
"Unrecognized operator %c
\n
"
,
thisop
->
op
);
default:
WINE_ERR
(
"Unrecognized operator %c
\n
"
,
thisop
);
}
heap_free
(
thisop
);
return
rc
;
}
...
...
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