From e59bd5d689a4bd7e2ef4cbc361a7a82255e84a51 Mon Sep 17 00:00:00 2001 From: dsandersoremutah Date: Tue, 17 Oct 2006 20:54:52 +0000 Subject: [PATCH] Fix for defect 211880. Code was accessing a NULL child block pointer, because parent block was incorrectly being set to NULL. git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@994 0109f412-320b-0410-ab79-c3e0c5ffbbe6 --- ftk/src/ftkbtree.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ftk/src/ftkbtree.cpp b/ftk/src/ftkbtree.cpp index cb0932f..9a8c8e3 100644 --- a/ftk/src/ftkbtree.cpp +++ b/ftk/src/ftkbtree.cpp @@ -5344,6 +5344,10 @@ RCODE F_BTree::moveEntriesToNextBlock( if( bCommonParent || (pParentStack->uiCurOffset < (FLMUINT)(getNumKeys( pParentStack->pucBlock) - 1))) { + if (pParentBlock) + { + pParentBlock->Release(); + } pParentBlock = pParentStack->pBlock; pucParentBlock = pParentStack->pucBlock; pParentBlock->AddRef(); @@ -5364,11 +5368,9 @@ RCODE F_BTree::moveEntriesToNextBlock( } pParentStack->pBlock = pParentBlock; + pParentStack->pBlock->AddRef(); pParentStack->pucBlock = pucParentBlock; - pParentBlock = NULL; - pucParentBlock = NULL; - bCommonParent = TRUE; } else