Hi,

I found that eina_list_sorted_merge did not set the accounting
correctly for all merged elements. This would lead to accidentally
free'd and double free'd accountings when some elements were later
removed from the list. Here's a patch that fixes this problem.

Best regards,

Olof Sjobergh
Index: eina/src/lib/eina_list.c
===================================================================
--- eina/src/lib/eina_list.c	(revision 37932)
+++ eina/src/lib/eina_list.c	(working copy)
@@ -1422,18 +1422,20 @@ eina_list_sorted_merge(Eina_List *left, Eina_List
      {
 	current->next = left;
 	left->prev = current;
+	current->accounting = ret->accounting;
      }
 
    if (right)
      {
 	current->next = right;
 	right->prev = current;
+	current->accounting = ret->accounting;
      }
 
    while (current->next)
      {
+	current = current->next;
 	current->accounting = ret->accounting;
-	current = current->next;
      }
 
    ret->accounting->last = current;
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to