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
e6bce797
Commit
e6bce797
authored
Jul 28, 2008
by
Lei Zhang
Committed by
Alexandre Julliard
Jul 30, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Check the return value from HeapAlloc.
parent
76e02581
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
wcmdmain.c
programs/cmd/wcmdmain.c
+16
-0
No files found.
programs/cmd/wcmdmain.c
View file @
e6bce797
...
...
@@ -601,10 +601,21 @@ void WCMD_execute (WCHAR *command, WCHAR *redirects,
/* Move copy of the command onto the heap so it can be expanded */
new_cmd
=
HeapAlloc
(
GetProcessHeap
(),
0
,
MAXSTRING
*
sizeof
(
WCHAR
));
if
(
!
new_cmd
)
{
WINE_ERR
(
"Could not allocate memory for new_cmd
\n
"
);
return
;
}
strcpyW
(
new_cmd
,
command
);
/* Move copy of the redirects onto the heap so it can be expanded */
new_redir
=
HeapAlloc
(
GetProcessHeap
(),
0
,
MAXSTRING
*
sizeof
(
WCHAR
));
if
(
!
new_redir
)
{
WINE_ERR
(
"Could not allocate memory for new_redir
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
new_cmd
);
return
;
}
/* If piped output, send stdout to the pipe by appending >filename to redirects */
if
(
piped
)
{
...
...
@@ -2086,6 +2097,11 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF
/* Allocate working space for a command read from keyboard, file etc */
if
(
!
extraSpace
)
extraSpace
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
MAXSTRING
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
extraSpace
)
{
WINE_ERR
(
"Could not allocate memory for extraSpace
\n
"
);
return
NULL
;
}
/* If initial command read in, use that, otherwise get input from handle */
if
(
optionalcmd
!=
NULL
)
{
...
...
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