diff options
author | unknown <jonas@perch.ndb.mysql.com> | 2006-04-07 17:10:56 +0200 |
---|---|---|
committer | unknown <jonas@perch.ndb.mysql.com> | 2006-04-07 17:10:56 +0200 |
commit | ec9b46a9b4b28a16e2b5212811a5ec30c9982722 (patch) | |
tree | 62587d62f2de24b214026ea7dda94fbc368c4481 /ndb | |
parent | c3058a64cf96d58c644fdb828a75c93187f58db5 (diff) | |
download | mariadb-git-ec9b46a9b4b28a16e2b5212811a5ec30c9982722.tar.gz |
ndb - bug#11034
fix mem leak (not during running of transactions, but a few bytes when shutting down)
ndb/src/ndbapi/NdbLinHash.hpp:
Make sure that getNext(0) actually finds first element
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; |