Fix possible memory leaking in PacketReader

Description

PacketCollectors and PacketListeners are stored in PacketReader. When they are removed PacketReader will set a null value to the collection instead of removing the slot in the collection. If new collectors or listeners are added to the packet reader then they are adding as new elements to the collection. Null slots are removing when processing incoming packets. Therefore, if no new packets are received (e.g. connection lost or server freezed) then it is possible for an application to remove listeners/collectors and create new ones. This action will end up consuming Smack's memory producing high loads of CPU to clean up garbarge that is never gone.

Environment

None
Fixed

Assignee

Alex Wenckus

Reporter

Gaston Dombiak

Labels

None

Expected Effort

None

Ignite Forum URL

None

Components

Fix versions

Affects versions

Priority

Critical
Configure