[OpenSIPS-Devel] [ opensips-Bugs-2688749 ] Orphaned list entries in localcache module

SourceForge.net noreply at sourceforge.net
Mon Mar 16 17:56:11 CET 2009


Bugs item #2688749, was opened at 2009-03-16 17:33
Message generated for change (Comment added) made by anca_vamanu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2688749&group_id=232389

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.
Category: modules
Group: trunk
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Phil D'Amore (ptdamore)
>Assigned to: Anca Vamanu (anca_vamanu)
Summary: Orphaned list entries in localcache module

Initial Comment:
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.

----------------------------------------------------------------------

>Comment By: Anca Vamanu (anca_vamanu)
Date: 2009-03-16 18:56

Message:
Hi Phil,

You were right, there was a bug when deleting the head of the list. I did
made a special case for this but instead of setting it to the rest if the
list, I just set it to NULL :). 
First, I applied your patch but then decided to keep the initial structure
and fix the bugs.

Thanks for the report and patch.

Anca 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=2688749&group_id=232389



More information about the Devel mailing list