mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
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
This commit is contained in:
parent
c3058a64cf
commit
ec9b46a9b4
1 changed files with 10 additions and 3 deletions
|
@ -427,19 +427,26 @@ NdbLinHash<C>::getNext(NdbElement_t<C> * curr){
|
||||||
return curr->next;
|
return curr->next;
|
||||||
|
|
||||||
int dir = 0, seg = 0;
|
int dir = 0, seg = 0;
|
||||||
|
int counts;
|
||||||
if(curr != 0){
|
if(curr != 0)
|
||||||
|
{
|
||||||
getBucket(curr->hash, &dir, &seg);
|
getBucket(curr->hash, &dir, &seg);
|
||||||
|
counts = seg + 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
counts = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int countd = dir; countd < DIRECTORYSIZE;countd++ ){
|
for(int countd = dir; countd < DIRECTORYSIZE;countd++ ){
|
||||||
if (directory[countd] != 0) {
|
if (directory[countd] != 0) {
|
||||||
for(int counts = seg + 1; counts < SEGMENTSIZE; counts++ ){
|
for(; counts < SEGMENTSIZE; counts++ ){
|
||||||
if (directory[countd]->elements[counts] != 0) {
|
if (directory[countd]->elements[counts] != 0) {
|
||||||
return directory[countd]->elements[counts];
|
return directory[countd]->elements[counts];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
counts = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue