Memory leak fix for event.c. Patch by Buginator.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5035 4a71c877-e1ca-e34f-864e-861f7616d084
master
Roman C 2008-05-11 10:34:48 +00:00
parent f7c684f964
commit 03073c8038
1 changed files with 5 additions and 0 deletions

View File

@ -667,6 +667,11 @@ void eventRemoveContext(SCRIPT_CONTEXT *psContext)
for(psCChunk = psContext->psGlobals; psCChunk; psCChunk = psNChunk) for(psCChunk = psContext->psGlobals; psCChunk; psCChunk = psNChunk)
{ {
psNChunk = psCChunk->psNext; psNChunk = psCChunk->psNext;
for(i=0;i < CONTEXT_VALS ; i++)
{
if(psCChunk->asVals[i].type == VAL_STRING && psCChunk->asVals[i].v.sval)
free(psCChunk->asVals[i].v.sval);
}
free(psCChunk); free(psCChunk);
} }