Audit some files for failures to set global pointers to NULL after calls

to free()


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1849 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2007-06-12 17:18:56 +00:00
parent 80026d553c
commit 6b9e5043be
4 changed files with 18 additions and 0 deletions

View File

@ -1052,6 +1052,7 @@ void systemShutdown(void)
debug(LOG_MAIN, "shutting down graphics subsystem");
free(DisplayBuffer);
DisplayBuffer = NULL;
iV_ShutDown();
levShutDown();
widgShutDown();

View File

@ -952,10 +952,13 @@ void viewDataShutDown(VIEWDATA *psViewData)
checkMessages((MSG_VIEWDATA *)psViewData);
free(psViewData->pName);
psViewData->pName = NULL;
//free the space allocated for the text messages
if (psViewData->numText)
{
free(psViewData->ppTextMsg);
psViewData->ppTextMsg = NULL;
}
//free the space allocated for multiple sequences
@ -970,13 +973,16 @@ void viewDataShutDown(VIEWDATA *psViewData)
if (psViewReplay->pSeqList[seqInc].numText)
{
free(psViewReplay->pSeqList[seqInc].ppTextMsg);
psViewReplay->pSeqList[seqInc].ppTextMsg = NULL;
}
if (psViewReplay->pSeqList[seqInc].pAudio)
{
free(psViewReplay->pSeqList[seqInc].pAudio);
psViewReplay->pSeqList[seqInc].pAudio = NULL;
}
}
free(psViewReplay->pSeqList);
psViewReplay->pSeqList = NULL;
}
}
else if (psViewData->type == VIEW_RES)
@ -985,11 +991,15 @@ void viewDataShutDown(VIEWDATA *psViewData)
if (psViewRes->pAudio)
{
free(psViewRes->pAudio);
psViewRes->pAudio = NULL;
}
}
free(psViewData->pData);
psViewData->pData = NULL;
}
free(psList->psViewData);
psList->psViewData = NULL;
//remove viewData list from the heap
if (psList == apsViewData)
{

View File

@ -161,6 +161,7 @@ void recvOptions(NETMSG *pMsg)
{
ingame.numStructureLimits = 0;
free(ingame.pStructureLimits);
ingame.pStructureLimits = NULL;
}
NetGet(pMsg,pos,player2dpid);
@ -545,6 +546,7 @@ BOOL multiShutdown(void)
{
ingame.numStructureLimits = 0;
free(ingame.pStructureLimits);
ingame.pStructureLimits = NULL;
}
return TRUE;
@ -1104,6 +1106,7 @@ BOOL multiGameShutdown(void)
{
ingame.numStructureLimits = 0;
free(ingame.pStructureLimits);
ingame.pStructureLimits = NULL;
}
ingame.localJoiningInProgress = FALSE; // clean up

View File

@ -279,6 +279,7 @@ static void deallocBodyStats(void)
free(psStat->ppIMDList);
}
free(asBodyStats);
asBodyStats = NULL;
}
/*Deallocate all the stats assigned from input data*/
@ -2586,12 +2587,14 @@ void deallocPropulsionTypes(void)
}
*/
free(asPropulsionTypes);
asPropulsionTypes = NULL;
}
//dealloc the storage assigned for the terrain table
void deallocTerrainTable(void)
{
free(asTerrainTable);
asTerrainTable = NULL;
}
//dealloc the storage assigned for the Special Ability stats
@ -2605,6 +2608,7 @@ void deallocSpecialAbility(void)
free(pList->pName);
}
free(asSpecialAbility);
asSpecialAbility = NULL;
}
//store the speed Factor in the terrain table