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 sh...@apache.org on 2008/12/11 08:03:50 UTC

svn commit: r725599 - in /webservices/axis2/trunk/c: axiom/src/om/om_node.c util/src/hash.c

Author: shankar
Date: Wed Dec 10 23:03:49 2008
New Revision: 725599

URL: http://svn.apache.org/viewvc?rev=725599&view=rev
Log:
Fix for AXIS2C-1317

Modified:
    webservices/axis2/trunk/c/axiom/src/om/om_node.c
    webservices/axis2/trunk/c/util/src/hash.c

Modified: webservices/axis2/trunk/c/axiom/src/om/om_node.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_node.c?rev=725599&r1=725598&r2=725599&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_node.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_node.c Wed Dec 10 23:03:49 2008
@@ -725,8 +725,8 @@
                     axutil_hash_t *new_hash = NULL;
                     new_hash =
                         axutil_hash_overlay(temp_namespaces, env, namespaces);
-                    /*if(namespaces)
-                      axutil_hash_free(namespaces, env);*/
+                    if(namespaces)
+                        axutil_hash_free(namespaces, env);
                     namespaces = new_hash;
                 }
                 namespace = axiom_element_get_namespace((axiom_element_t

Modified: webservices/axis2/trunk/c/util/src/hash.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/hash.c?rev=725599&r1=725598&r2=725599&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/hash.c (original)
+++ webservices/axis2/trunk/c/util/src/hash.c Wed Dec 10 23:03:49 2008
@@ -451,7 +451,7 @@
     axutil_hash_entry_t *new_vals = NULL;
     axutil_hash_entry_t *iter;
     axutil_hash_entry_t *ent;
-    unsigned int i, j, k;
+    unsigned int i, k;
 
 #if AXIS2_POOL_DEBUG
     /* we don't copy keys and values, so it's necessary that
@@ -483,25 +483,18 @@
         res->max = res->max * 2 + 1;
     }
     res->array = axutil_hash_alloc_array(res, res->max);
-    if (base->count + overlay->count)
-    {
-        new_vals = AXIS2_MALLOC(env->allocator,
-                       sizeof(axutil_hash_entry_t) * (base->count +
-                       overlay->count));
-    }
-    j = 0;
     for (k = 0; k <= base->max; k++)
     {
         for (iter = base->array[k]; iter; iter = iter->next)
         {
             i = iter->hash & res->max;
-            new_vals[j].klen = iter->klen;
-            new_vals[j].key = iter->key;
-            new_vals[j].val = iter->val;
-            new_vals[j].hash = iter->hash;
-            new_vals[j].next = res->array[i];
-            res->array[i] = &new_vals[j];
-            j++;
+            new_vals = AXIS2_MALLOC(env->allocator, sizeof(axutil_hash_entry_t));
+            new_vals->klen = iter->klen;
+            new_vals->key = iter->key;
+            new_vals->val = iter->val;
+            new_vals->hash = iter->hash;
+            new_vals->next = res->array[i];
+            res->array[i] = new_vals;
         }
     }
 
@@ -530,14 +523,14 @@
             }
             if (!ent)
             {
-                new_vals[j].klen = iter->klen;
-                new_vals[j].key = iter->key;
-                new_vals[j].val = iter->val;
-                new_vals[j].hash = iter->hash;
-                new_vals[j].next = res->array[i];
-                res->array[i] = &new_vals[j];
+                new_vals = AXIS2_MALLOC(env->allocator, sizeof(axutil_hash_entry_t));
+                new_vals->klen = iter->klen;
+                new_vals->key = iter->key;
+                new_vals->val = iter->val;
+                new_vals->hash = iter->hash;
+                new_vals->next = res->array[i];
+                res->array[i] = new_vals;
                 res->count++;
-                j++;
             }
         }
     }