summaryrefslogtreecommitdiff
path: root/src/hash.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-04-23 08:01:36 +0000
committerMike Buland <eichlan@xagasoft.com>2007-04-23 08:01:36 +0000
commitf8d4301e9fa4f3709258505941e37fab2eadadc6 (patch)
treee23bec8fd98a61010812c60230ab156578092232 /src/hash.h
parentcc0a8e19f2bb9b80c15aca1ceac2faf79fc4278b (diff)
downloadlibbu++-f8d4301e9fa4f3709258505941e37fab2eadadc6.tar.gz
libbu++-f8d4301e9fa4f3709258505941e37fab2eadadc6.tar.bz2
libbu++-f8d4301e9fa4f3709258505941e37fab2eadadc6.tar.xz
libbu++-f8d4301e9fa4f3709258505941e37fab2eadadc6.zip
Fixed a major bug in the rehash algorithm. If any items were erased, then a
rehash occured, a double-free would also occur...very sad. That's all fixed now.
Diffstat (limited to '')
-rw-r--r--src/hash.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/hash.h b/src/hash.h
index e819379..a21d651 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -641,7 +641,8 @@ protected:
641 // Delete all of the old data 641 // Delete all of the old data
642 for( uint32_t j = 0; j < nOldCapacity; j++ ) 642 for( uint32_t j = 0; j < nOldCapacity; j++ )
643 { 643 {
644 if( (bOldFilled[j/32]&(1<<(j%32)))!=0 ) 644 if( (bOldFilled[j/32]&(1<<(j%32)))!=0 &&
645 (bOldDeleted[j/32]&(1<<(j%32)))==0 )
645 { 646 {
646 va.destroy( &aOldValues[j] ); 647 va.destroy( &aOldValues[j] );
647 ka.destroy( &aOldKeys[j] ); 648 ka.destroy( &aOldKeys[j] );