From a2f38542a356373fe3a13a3a5ec0beb1eb7152bb Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Thu, 5 Mar 2009 11:19:56 +0100 Subject: Fix a read of a freed memory address. --- src/wsbm_slabpool.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wsbm_slabpool.c b/src/wsbm_slabpool.c index e1b4228..51a85d0 100644 --- a/src/wsbm_slabpool.c +++ b/src/wsbm_slabpool.c @@ -571,7 +571,7 @@ wsbmSlabFreeBufferLocked(struct _WsbmSlabBuffer *buf) static void wsbmSlabCheckFreeLocked(struct _WsbmSlabSizeHeader *header, int wait) { - struct _WsbmListHead *list, *prev, *first; + struct _WsbmListHead *list, *prev, *first, *head; struct _WsbmSlabBuffer *sBuf; struct _WsbmSlab *slab; int firstWasSignaled = 1; @@ -603,7 +603,8 @@ wsbmSlabCheckFreeLocked(struct _WsbmSlabSizeHeader *header, int wait) * through since we're currently the only user. */ - WSBMLISTFOREACHPREVSAFE(list, prev, first->next) { + head = first->next; + WSBMLISTFOREACHPREVSAFE(list, prev, head) { if (list == &header->delayedBuffers) break; -- cgit v1.2.3