Prevent a segfault in dynafile creation

A failure during the dynafile creation (in prepareFile(), most of the
time) led to a misaddressing and a segfault.
This commit is contained in:
Tomas Heinrich 2015-07-17 21:00:23 +02:00
parent be940cf970
commit 008f0097b6

View File

@ -768,7 +768,8 @@ prepareDynFile(instanceData *__restrict__ const pData, const uchar *__restrict__
DBGPRINTF("Added new entry %d for file cache, file '%s'.\n", iFirstFree, newFileName);
finalize_it:
pCache[pData->iCurrElt]->nInactive = 0;
if(iRet == RS_RET_OK)
pCache[pData->iCurrElt]->nInactive = 0;
RETiRet;
}