diff options
author | jonas@perch.ndb.mysql.com <> | 2006-04-07 17:10:56 +0200 |
---|---|---|
committer | jonas@perch.ndb.mysql.com <> | 2006-04-07 17:10:56 +0200 |
commit | 739b0d676b7a7ff939aa4e667d0a146a5f0d6b2b (patch) | |
tree | 62587d62f2de24b214026ea7dda94fbc368c4481 /ndb | |
parent | 7cd90d0081e8acdc9fd36f5536d06289e35cb19e (diff) | |
download | mariadb-git-739b0d676b7a7ff939aa4e667d0a146a5f0d6b2b.tar.gz |
ndb - bug#11034
fix mem leak (not during running of transactions, but a few bytes when shutting down)
Diffstat (limited to 'ndb')
-rw-r--r-- | ndb/src/ndbapi/NdbLinHash.hpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/ndb/src/ndbapi/NdbLinHash.hpp b/ndb/src/ndbapi/NdbLinHash.hpp index 05670534c95..0655e81ce9d 100644 --- a/ndb/src/ndbapi/NdbLinHash.hpp +++ b/ndb/src/ndbapi/NdbLinHash.hpp @@ -427,19 +427,26 @@ NdbLinHash<C>::getNext(NdbElement_t<C> * curr){ return curr->next; int dir = 0, seg = 0; - - if(curr != 0){ + int counts; + if(curr != 0) + { getBucket(curr->hash, &dir, &seg); + counts = seg + 1; + } + else + { + counts = 0; } for(int countd = dir; countd < DIRECTORYSIZE;countd++ ){ if (directory[countd] != 0) { - for(int counts = seg + 1; counts < SEGMENTSIZE; counts++ ){ + for(; counts < SEGMENTSIZE; counts++ ){ if (directory[countd]->elements[counts] != 0) { return directory[countd]->elements[counts]; } } } + counts = 0; } return 0; |