diff --git a/src/mcom/MSU.c b/src/mcom/MSU.c index 0bf02ac..a8c4bcd 100644 --- a/src/mcom/MSU.c +++ b/src/mcom/MSU.c @@ -956,6 +956,9 @@ int MSUSendData( #endif /* !__MPROD */ /* initialize */ + TSLine[0]='\0'; + CKLine[0]='\0'; + SHeader[0]='\0'; tmpSBuf[0] = '\0'; /* tmpSBuf is global (not threadsafe) */ diff --git a/src/moab/MNode.c b/src/moab/MNode.c index 53f35c0..1e42df9 100644 --- a/src/moab/MNode.c +++ b/src/moab/MNode.c @@ -5746,10 +5746,11 @@ int MNodeGetLocation( int nindex; char tmpName[MAX_MNAME]; + tmpName[0]='\0'; char *ptr; - long Address; + long Address=0; mhost_t *S; diff --git a/src/moab/MRes.c b/src/moab/MRes.c index 2e3d56a..7d24b77 100644 --- a/src/moab/MRes.c +++ b/src/moab/MRes.c @@ -7137,14 +7137,20 @@ int MResAdjustDRes( { memset(&ZRes,0,sizeof(ZRes)); - 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)); + /* changed the mallocs to callocs because there is code below */ + /* that requires things to be zero'ed */ + if (CRE == NULL ) { + CRE = (mre_t *)calloc((MSched.ResDepth << 1),sizeof(mre_t)); + } + if (ORE == NULL ){ + ORE = (mre_t *)calloc((MSched.ResDepth << 1),sizeof(mre_t)); + } + if (NRE == NULL ){ + NRE = (mre_t *)calloc((MSched.ResDepth << 1),sizeof(mre_t)); + } + if (JRE == NULL ){ + JRE = (mre_t *)calloc((MSched.ResDepth << 1),sizeof(mre_t)); + } DRSize = sizeof(mcres_t); } /* END if (CRE == NULL) */