Marcus Meissner : quartz: Avoid linked list walk with free next (Coverity).
Module: wine Branch: master Commit: de7635a2f0a1424b14318788f935ff2a3d531a79 URL: http://source.winehq.org/git/wine.git/?a=commit;h=de7635a2f0a1424b14318788f9... Author: Marcus Meissner <marcus(a)jet.franken.de> Date: Fri Aug 17 22:36:48 2012 +0200 quartz: Avoid linked list walk with free next (Coverity). --- dlls/quartz/systemclock.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c index 842541b..043299b 100644 --- a/dlls/quartz/systemclock.c +++ b/dlls/quartz/systemclock.c @@ -116,12 +116,15 @@ static DWORD WINAPI SystemClockAdviseThread(LPVOID lpParam) { } /** First SingleShots Advice: sorted list */ - for (it = This->pSingleShotAdvise; NULL != it && (it->rtBaseTime + it->rtIntervalTime) <= curTime; it = it->next) { + it = This->pSingleShotAdvise; + while ((NULL != it) && (it->rtBaseTime + it->rtIntervalTime) <= curTime) { + SystemClockAdviseEntry* nextit = it->next; /** send event ... */ SetEvent(it->hEvent); /** ... and Release it */ QUARTZ_RemoveAviseEntryFromQueue(This, it); CoTaskMemFree(it); + it = nextit; } if (NULL != it) timeOut = (DWORD) ((it->rtBaseTime + it->rtIntervalTime) - curTime) / (REFERENCE_TIME)10000;
participants (1)
-
Alexandre Julliard