From 22dfd5a1170aba2201cf85e9b75a3ae1d3c01850 Mon Sep 17 00:00:00 2001 From: Sears Russell Date: Sat, 21 Apr 2007 07:51:33 +0000 Subject: [PATCH] Fixed use after free. --- src/lladd/io/non_blocking.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lladd/io/non_blocking.c b/src/lladd/io/non_blocking.c index 7260407..42f89d8 100644 --- a/src/lladd/io/non_blocking.c +++ b/src/lladd/io/non_blocking.c @@ -492,10 +492,11 @@ static void * nbw_worker(void * handle) { pthread_mutex_lock(&impl->mut); node->pin_count--; } + tree_node * new_node = (tree_node*)RB_ENTRY(lookup)(RB_LUGREAT, node, impl->fast_handles); if(!node->dirty && !node->pin_count) { freeFastHandle(impl, node); } - node = (tree_node*)RB_ENTRY(lookup)(RB_LUGREAT, node, impl->fast_handles); + node = new_node; } if(!impl->fast_handle_count || !writes) { if(impl->still_open) {