- Inside IdleConnList::removeAt method the last element of the
IdleConnList::theList_ array initialized with random memory
- Inside IdleConnList::removeAt method if the IdleConnList::parent_ is NULL
(ICAP connections pools) the size_ of the array is not decreased after
element removed
- Inside IdleConnList::closeN method, it removes always all elements from the
list except the first one
return false;
// shuffle the remaining entries to fill the new gap.
- for (; index < size_ - 1; index++)
+ for (; index < size_ - 2; index++)
theList_[index] = theList_[index + 1];
theList_[size_-1] = NULL;
if (parent_) {
parent_->noteConnectionRemoved();
+ }
- if (--size_ == 0) {
- debugs(48, 3, HERE << "deleting " << hashKeyStr(&hash));
- delete this;
- }
+ if (--size_ == 0) {
+ debugs(48, 3, HERE << "deleting " << hashKeyStr(&hash));
+ delete this;
}
return true;
}
conn->close();
if (parent_)
parent_->noteConnectionRemoved();
+ ++index;
}
// shuffle the list N down.
for (; index < (size_t)size_; index++) {