libwinpr-utils/queue: fix a memory corruption in Queue_Clear.

This commit is contained in:
Vic Lee 2012-12-24 12:45:55 +08:00
parent b9c7a423bb
commit 48c0c4b090
1 changed files with 1 additions and 1 deletions

View File

@ -85,7 +85,7 @@ void Queue_Clear(wQueue* queue)
if (queue->synchronized)
WaitForSingleObject(queue->mutex, INFINITE);
for (index = queue->head; index != queue->tail; index++)
for (index = queue->head; index != queue->tail; index = (index + 1) % queue->capacity)
{
if (queue->object.fnObjectFree)
queue->object.fnObjectFree(queue->array[index]);