You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2006/03/23 06:17:05 UTC

svn commit: r388042 - /webservices/axis2/trunk/c/modules/util/linked_list.c

Author: sahan
Date: Wed Mar 22 21:17:00 2006
New Revision: 388042

URL: http://svn.apache.org/viewcvs?rev=388042&view=rev
Log:
Fixed the freeing logic in linked list

Modified:
    webservices/axis2/trunk/c/modules/util/linked_list.c

Modified: webservices/axis2/trunk/c/modules/util/linked_list.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/linked_list.c?rev=388042&r1=388041&r2=388042&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/linked_list.c (original)
+++ webservices/axis2/trunk/c/modules/util/linked_list.c Wed Mar 22 21:17:00 2006
@@ -318,6 +318,7 @@
                                         axis2_env_t **env)
 {
     axis2_linked_list_impl_t *linked_list_impl = NULL;
+    entry_t *current = NULL, *next = NULL;
     
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     
@@ -329,7 +330,14 @@
         linked_list_impl->linked_list.ops = NULL;
     }
     
-    if(NULL != linked_list_impl->first)
+    current = linked_list_impl->first;
+    while(NULL != current)
+    {
+        next = current->next;
+        AXIS2_FREE((*env)->allocator, current); 
+        current = next;
+    }
+    /*if(NULL != linked_list_impl->first)
     {
         free_entry(linked_list_impl->first, env);
     }
@@ -337,7 +345,7 @@
     if(NULL != linked_list_impl->last)
     {
         free_entry(linked_list_impl->last, env);
-    }
+    }*/
     
     AXIS2_FREE((*env)->allocator, linked_list_impl);
     linked_list_impl = NULL;