axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r350215 - in /webservices/axis2/trunk/c/modules: util/src/hash.c xml/om/src/axis2_om_comment.c xml/om/src/axis2_om_element.c xml/om/src/axis2_om_stax_builder.c xml/parser/libxml2/src/axis2_libxml2_writer_wrapper.c
Date Thu, 01 Dec 2005 09:12:12 GMT
Author: samisa
Date: Thu Dec  1 01:11:54 2005
New Revision: 350215

URL: http://svn.apache.org/viewcvs?rev=350215&view=rev
Log:
memory leaks fixed

Modified:
    webservices/axis2/trunk/c/modules/util/src/hash.c
    webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_comment.c
    webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_element.c
    webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c
    webservices/axis2/trunk/c/modules/xml/parser/libxml2/src/axis2_libxml2_writer_wrapper.c

Modified: webservices/axis2/trunk/c/modules/util/src/hash.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/src/hash.c?rev=350215&r1=350214&r2=350215&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/src/hash.c (original)
+++ webservices/axis2/trunk/c/modules/util/src/hash.c Thu Dec  1 01:11:54 2005
@@ -520,12 +520,18 @@
 AXIS2_DECLARE(axis2_status_t)
 axis2_hash_free (axis2_hash_t *ht, axis2_env_t** environment)
 {
+    int i =0;
     AXIS2_ENV_CHECK(environment, AXIS2_FAILURE);
     if (ht)
     {
-        if (ht->free)
-            axis2_hash_entry_free (environment, ht->free);
-        AXIS2_FREE((*environment)->allocator, ht->array);
+        for(i = 0;i <ht->max; i++)
+        {
+            if(ht->array[i])
+            {
+                AXIS2_FREE((*environment)->allocator, ht->array[i]);
+            }
+        }
+        AXIS2_FREE((*environment)->allocator, (ht->array));
         AXIS2_FREE ((*environment)->allocator, ht);
         return AXIS2_SUCCESS;
     }

Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_comment.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_comment.c?rev=350215&r1=350214&r2=350215&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_comment.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_comment.c Thu Dec  1 01:11:54 2005
@@ -131,7 +131,7 @@
         AXIS2_FREE ((*env)->allocator, comment_impl->value);
     }
     AXIS2_FREE((*env)->allocator, om_comment->ops);
-    AXIS2_FREE((*env)->allocator,AXIS2_INTF_TO_IMPL(om_comment));
+    AXIS2_FREE((*env)->allocator,comment_impl);
     return AXIS2_SUCCESS;
 }
 

Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_element.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_element.c?rev=350215&r1=350214&r2=350215&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_element.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_element.c Thu Dec  1 01:11:54 2005
@@ -388,9 +388,10 @@
     }
 
     if (AXIS2_OM_NAMESPACE_GET_PREFIX(ns,env))
-        axis2_hash_set (AXIS2_INTF_TO_IMPL(element)->namespaces,
+    {   axis2_hash_set (AXIS2_INTF_TO_IMPL(element)->namespaces,
                         AXIS2_OM_NAMESPACE_GET_PREFIX(ns,env),
                         AXIS2_HASH_KEY_STRING, ns);
+    }
     else
     {
         axis2_hash_set (AXIS2_INTF_TO_IMPL(element)->namespaces,

Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c?rev=350215&r1=350214&r2=350215&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c Thu Dec  1 01:11:54
2005
@@ -318,33 +318,43 @@
         if(AXIS2_STRCMP(temp_ns_prefix,"xmlns") == 0 || !temp_ns_prefix)
         {
              axis2_om_element_t *om_ele = NULL;
+             om_ele = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(node, env);
+            
              om_ns = axis2_om_namespace_create ( env,
                          temp_ns_uri, NULL );
-             om_ele = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(node, env);
              status = AXIS2_OM_ELEMENT_DECLARE_NAMESPACE( om_ele, env, node, om_ns);
             
              temp_ns = AXIS2_OM_ELEMENT_FIND_DECLARED_NAMESPACE(om_ele, env, temp_ns_uri,
NULL);
              if(temp_ns)
-               AXIS2_OM_ELEMENT_SET_NAMESPACE (om_ele, env, om_ns, node);               
        
-                                                 
+             {
+                AXIS2_OM_ELEMENT_SET_NAMESPACE (om_ele, env, om_ns, node); 
+             }                 
+             else
+             {
+                AXIS2_OM_NAMESPACE_FREE(om_ns, env);
+                om_ns = NULL;
+             }
+                       
         }
         else
-        {                                            
-           om_ns = axis2_om_namespace_create ( env,
+        {       
+            axis2_om_element_t *om_ele = NULL;
+            om_ele = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(node, env);
+            
+            om_ns = axis2_om_namespace_create ( env,
                          temp_ns_uri, temp_ns_prefix );
-           status = AXIS2_OM_ELEMENT_DECLARE_NAMESPACE(
-                        (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(node, env),
-                        env, node, om_ns);
-                                     
+            status = AXIS2_OM_ELEMENT_DECLARE_NAMESPACE( om_ele, env, node, om_ns);
+                    
+            temp_ns = AXIS2_OM_ELEMENT_FIND_DECLARED_NAMESPACE(om_ele, env, temp_ns_uri,temp_ns_prefix);
+           
         }        
         AXIS2_XML_READER_XML_FREE(builder->parser, env, temp_ns_prefix);
         AXIS2_XML_READER_XML_FREE(builder->parser, env, temp_ns_uri);
-                                
         if (!om_ns)
         {
             /* something went wrong */
             return AXIS2_FAILURE;
-        }
+        }                   
     }
     /* set own namespace */
     temp_prefix = AXIS2_XML_READER_GET_PREFIX ( builder->parser, env);

Modified: webservices/axis2/trunk/c/modules/xml/parser/libxml2/src/axis2_libxml2_writer_wrapper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/libxml2/src/axis2_libxml2_writer_wrapper.c?rev=350215&r1=350214&r2=350215&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/libxml2/src/axis2_libxml2_writer_wrapper.c
(original)
+++ webservices/axis2/trunk/c/modules/xml/parser/libxml2/src/axis2_libxml2_writer_wrapper.c
Thu Dec  1 01:11:54 2005
@@ -267,7 +267,6 @@
                    sizeof(axis2_libxml2_writer_wrapper_impl_t));
     if(!writer_impl)
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
-     
     writer_impl->xml_writer = xmlNewTextWriterFilename(filename, compression);
     
     if(!(writer_impl->xml_writer))
@@ -384,7 +383,6 @@
 {
     axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    
     writer_impl = (axis2_libxml2_writer_wrapper_impl_t *)AXIS2_MALLOC((*env)->allocator,
                    sizeof(axis2_libxml2_writer_wrapper_impl_t));
     if(!writer_impl)
@@ -1369,4 +1367,4 @@
         
         writer_impl->qname_array.current_no = 0;    
     return AXIS2_SUCCESS;
-}
+}



Mime
View raw message