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
0c01b71a
Commit
0c01b71a
authored
Jun 15, 2009
by
Francois Gouget
Committed by
Alexandre Julliard
Jun 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Replace malloc() with HeapAlloc().
parent
c48e5e04
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
builtins.c
programs/cmd/builtins.c
+1
-1
wcmdmain.c
programs/cmd/wcmdmain.c
+4
-5
No files found.
programs/cmd/builtins.c
View file @
0c01b71a
...
...
@@ -1033,7 +1033,7 @@ void WCMD_part_execute(CMD_LIST **cmdList, WCHAR *firstcmd, WCHAR *variable,
if
(
conditionTRUE
&&
firstcmd
&&
*
firstcmd
)
{
WCHAR
*
command
=
WCMD_strdupW
(
firstcmd
);
WCMD_execute
(
firstcmd
,
(
*
cmdList
)
->
redirects
,
variable
,
value
,
cmdList
);
free
(
command
);
HeapFree
(
GetProcessHeap
(),
0
,
command
);
}
...
...
programs/cmd/wcmdmain.c
View file @
0c01b71a
...
...
@@ -416,8 +416,7 @@ static void WCMD_show_prompt (void) {
*/
WCHAR
*
WCMD_strdupW
(
WCHAR
*
input
)
{
int
len
=
strlenW
(
input
)
+
1
;
/* Note: Use malloc not HeapAlloc to emulate strdup */
WCHAR
*
result
=
malloc
(
len
*
sizeof
(
WCHAR
));
WCHAR
*
result
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
memcpy
(
result
,
input
,
len
*
sizeof
(
WCHAR
));
return
result
;
}
...
...
@@ -749,9 +748,9 @@ static WCHAR *WCMD_expand_envvar(WCHAR *start, WCHAR *forVar, WCHAR *forVal) {
thisVarContents
+
(
lastFound
-
searchIn
));
strcatW
(
outputposn
,
s
);
}
free
(
s
);
free
(
searchIn
);
free
(
searchFor
);
HeapFree
(
GetProcessHeap
(),
0
,
s
);
HeapFree
(
GetProcessHeap
(),
0
,
searchIn
);
HeapFree
(
GetProcessHeap
(),
0
,
searchFor
);
return
start
;
}
return
start
+
1
;
...
...
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