summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom-at-vmware-dot-com>2009-03-05 11:19:56 +0100
committerThomas Hellstrom <thellstrom-at-vmware-dot-com>2009-03-05 11:21:41 +0100
commita2f38542a356373fe3a13a3a5ec0beb1eb7152bb (patch)
treee06cb3b97b0aafbd1767ad1cd00c81971b56b1b6
parent618b555bc2f5342a6baa88acdc7cd07883203ac0 (diff)
Fix a read of a freed memory address.
-rw-r--r--src/wsbm_slabpool.c5
1 files 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;