- all the mallocs in the MResAdjustDRes() function should really be checked independently for success or failure instead of just the CRE malloc

git-svn-id: svn://opensvn.adaptivecomputing.com/maui/trunk@140 3f5042e3-fb1d-0410-be18-d6ca2573e517
This commit is contained in:
jasonw 2010-08-02 18:24:51 +00:00
parent 5eaf1487c6
commit bf8743a61a

View File

@ -7133,19 +7133,23 @@ int MResAdjustDRes(
/* where possible using memcmp. Insert all container reservation */
/* events at BRes calculation completion */
if (CRE == NULL)
if (CRE == NULL || ORE == NULL || NRE == NULL || JRE == NULL )
{
memset(&ZRes,0,sizeof(ZRes));
CRE = (mre_t *)malloc(sizeof(mre_t) * (MSched.ResDepth << 1));
ORE = (mre_t *)malloc(sizeof(mre_t) * (MSched.ResDepth << 1));
NRE = (mre_t *)malloc(sizeof(mre_t) * (MSched.ResDepth << 1));
JRE = (mre_t *)malloc(sizeof(mre_t) * (MSched.ResDepth << 1));
if (CRE == NULL )
CRE = (mre_t *)malloc(sizeof(mre_t) * (MSched.ResDepth << 1));
if (ORE == NULL )
ORE = (mre_t *)malloc(sizeof(mre_t) * (MSched.ResDepth << 1));
if (NRE == NULL )
NRE = (mre_t *)malloc(sizeof(mre_t) * (MSched.ResDepth << 1));
if (JRE == NULL )
JRE = (mre_t *)malloc(sizeof(mre_t) * (MSched.ResDepth << 1));
DRSize = sizeof(mcres_t);
} /* END if (CRE == NULL) */
if (CRE == NULL)
if (CRE == NULL || ORE == NULL || NRE == NULL || JRE == NULL )
{
DBG(4,fCORE) DPrint("ALERT: cannot allocate memory in %s\n",
FName);