Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Submitted By: Phil D'Amore (ptdamore)
Assigned to: Nobody/Anonymous (nobody)
Summary: Orphaned list entries in localcache module
There is a corner case when deleting from the hash when the removed item is at the head of a particular hash bucket list.
This tends to cause a problem mostly in the functions localcache_clean and lcache_htable_remove_safe. When these functions find the node to be deleted and it's at the head of the list, the head node is deleted, the entries pointer is NULL'd out, and the code stops right there, leaving any other nodes in that list orphaned forever.
The attached patch changes the structure of the list slightly to have an empty node at the head. This eliminates corner cases in the code that walk/modify the list and also eliminates the memory leaks.