mirror of
https://github.com/reactos/reactos.git
synced 2026-06-02 17:31:23 +08:00
[CMD] Add missing memory allocation NULL checks (#161). CORE-8304
Adapted from a patch by Jacob S. Preciado. Bring also the code suggestions emitted during review.
This commit is contained in:
@@ -178,8 +178,9 @@ INT cmd_start (LPTSTR Rest)
|
||||
|
||||
/* get comspec */
|
||||
comspec = cmd_alloc ( MAX_PATH * sizeof(TCHAR));
|
||||
if (comspec == NULL)
|
||||
if (!comspec)
|
||||
{
|
||||
WARN("Cannot allocate memory for start comspec!\n");
|
||||
error_out_of_memory();
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user