ERR: Added error check for malloc of process control structure.

This commit is contained in:
Brad King 2003-06-12 16:18:07 -04:00
parent ef5214c6c5
commit 751509cf10
1 changed files with 5 additions and 0 deletions

View File

@ -210,6 +210,11 @@ kwsysProcess* kwsysProcess_New()
/* Allocate a process control structure. */ /* Allocate a process control structure. */
cp = (kwsysProcess*)malloc(sizeof(kwsysProcess)); cp = (kwsysProcess*)malloc(sizeof(kwsysProcess));
if(!cp)
{
/* Could not allocate memory for the control structure. */
return 0;
}
ZeroMemory(cp, sizeof(*cp)); ZeroMemory(cp, sizeof(*cp));
/* Set initial status. */ /* Set initial status. */