Skip to content

Commit

Permalink
Prevent a segfault in dynafile creation
Browse files Browse the repository at this point in the history
A failure during the dynafile creation (in prepareFile(), most of the
time) led to a misaddressing and a segfault.
  • Loading branch information
theinric committed Jul 18, 2015
1 parent be940cf commit 008f009
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/omfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 008f009

Please sign in to comment.