diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c index abe6b9e24..ed50efee3 100644 --- a/Source/kwsys/ProcessWin32.c +++ b/Source/kwsys/ProcessWin32.c @@ -210,6 +210,11 @@ kwsysProcess* kwsysProcess_New() /* Allocate a process control structure. */ cp = (kwsysProcess*)malloc(sizeof(kwsysProcess)); + if(!cp) + { + /* Could not allocate memory for the control structure. */ + return 0; + } ZeroMemory(cp, sizeof(*cp)); /* Set initial status. */