diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-04-23 08:01:36 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-04-23 08:01:36 +0000 |
commit | f8d4301e9fa4f3709258505941e37fab2eadadc6 (patch) | |
tree | e23bec8fd98a61010812c60230ab156578092232 /src | |
parent | cc0a8e19f2bb9b80c15aca1ceac2faf79fc4278b (diff) | |
download | libbu++-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.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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] ); |