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
474276d5
Commit
474276d5
authored
Mar 22, 2009
by
James Hawkins
Committed by
Alexandre Julliard
Mar 23, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Fix a memory leak (Coverity 904).
parent
0b74259f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
wcmdmain.c
programs/cmd/wcmdmain.c
+2
-3
No files found.
programs/cmd/wcmdmain.c
View file @
474276d5
...
@@ -699,8 +699,8 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start, WCHAR *forVar, WCHAR *forVal) {
...
@@ -699,8 +699,8 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start, WCHAR *forVar, WCHAR *forVal) {
WCHAR
*
searchIn
;
WCHAR
*
searchIn
;
WCHAR
*
searchFor
;
WCHAR
*
searchFor
;
s
=
WCMD_strdupW
(
endOfVar
+
1
);
if
(
equalspos
==
NULL
)
return
start
+
1
;
if
(
equalspos
==
NULL
)
return
start
+
1
;
s
=
WCMD_strdupW
(
endOfVar
+
1
);
/* Null terminate both strings */
/* Null terminate both strings */
thisVar
[
strlenW
(
thisVar
)
-
1
]
=
0x00
;
thisVar
[
strlenW
(
thisVar
)
-
1
]
=
0x00
;
...
@@ -712,7 +712,6 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start, WCHAR *forVar, WCHAR *forVal) {
...
@@ -712,7 +712,6 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start, WCHAR *forVar, WCHAR *forVal) {
searchFor
=
WCMD_strdupW
(
colonpos
+
1
);
searchFor
=
WCMD_strdupW
(
colonpos
+
1
);
CharUpperBuff
(
searchFor
,
strlenW
(
colonpos
+
1
));
CharUpperBuff
(
searchFor
,
strlenW
(
colonpos
+
1
));
/* Handle wildcard case */
/* Handle wildcard case */
if
(
*
(
colonpos
+
1
)
==
'*'
)
{
if
(
*
(
colonpos
+
1
)
==
'*'
)
{
/* Search for string to replace */
/* Search for string to replace */
...
@@ -723,7 +722,6 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start, WCHAR *forVar, WCHAR *forVal) {
...
@@ -723,7 +722,6 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start, WCHAR *forVar, WCHAR *forVal) {
strcpyW
(
start
,
replacewith
);
strcpyW
(
start
,
replacewith
);
strcatW
(
start
,
thisVarContents
+
(
found
-
searchIn
)
+
strlenW
(
searchFor
+
1
));
strcatW
(
start
,
thisVarContents
+
(
found
-
searchIn
)
+
strlenW
(
searchFor
+
1
));
strcatW
(
start
,
s
);
strcatW
(
start
,
s
);
free
(
s
);
}
else
{
}
else
{
/* Copy as it */
/* Copy as it */
strcpyW
(
start
,
thisVarContents
);
strcpyW
(
start
,
thisVarContents
);
...
@@ -749,6 +747,7 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start, WCHAR *forVar, WCHAR *forVal) {
...
@@ -749,6 +747,7 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start, WCHAR *forVar, WCHAR *forVal) {
thisVarContents
+
(
lastFound
-
searchIn
));
thisVarContents
+
(
lastFound
-
searchIn
));
strcatW
(
outputposn
,
s
);
strcatW
(
outputposn
,
s
);
}
}
free
(
s
);
free
(
searchIn
);
free
(
searchIn
);
free
(
searchFor
);
free
(
searchFor
);
return
start
;
return
start
;
...
...
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