You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by na...@apache.org on 2006/03/01 04:22:22 UTC

svn commit: r381889 - in /webservices/axis2/trunk/c/modules/xml: om/om_element.c soap/soap_envelope.c

Author: nandika
Date: Tue Feb 28 19:22:20 2006
New Revision: 381889

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

Modified:
    webservices/axis2/trunk/c/modules/xml/om/om_element.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c

Modified: webservices/axis2/trunk/c/modules/xml/om/om_element.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/om_element.c?rev=381889&r1=381888&r2=381889&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/om_element.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/om_element.c Tue Feb 28 19:22:20 2006
@@ -863,8 +863,15 @@
                                axis2_env_t **env,
                                const axis2_char_t *localname)
 {
+    axis2_om_element_impl_t *om_ele_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, localname, AXIS2_FAILURE);
+    om_ele_impl = AXIS2_INTF_TO_IMPL(om_element);
+    if(om_ele_impl->localname)
+    {
+        AXIS2_FREE((*env)->allocator, om_ele_impl->localname);
+        om_ele_impl->localname = NULL;
+    }
     AXIS2_INTF_TO_IMPL(om_element)->localname = 
         (axis2_char_t*)AXIS2_STRDUP(localname,env);
     return AXIS2_SUCCESS;        

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c?rev=381889&r1=381888&r2=381889&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c Tue Feb 28 19:22:20 2006
@@ -332,6 +332,7 @@
     axis2_soap_envelope_impl_t *envelope_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     envelope_impl = AXIS2_INTF_TO_IMPL(envelope);
+    /*
     if(envelope_impl->soap_version && envelope_impl->soap_version != soap_version)
     {
         axis2_om_namespace_t *om_ns    = NULL;
@@ -351,6 +352,7 @@
         om_ns = axis2_om_namespace_create(env, uri, AXIS2_SOAP_DEFAULT_NAMESPACE_PREFIX);
         AXIS2_OM_ELEMENT_SET_NAMESPACE(env_ele, env, om_ns, envelope_impl->om_ele_node);
     }
+    */
     envelope_impl->soap_version = soap_version;
     return AXIS2_SUCCESS;
 }
@@ -475,7 +477,7 @@
                         fault_value_om_ele = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(fault_value_om_node, env);
                         text = AXIS2_OM_ELEMENT_GET_TEXT(fault_value_om_ele, env, fault_value_om_node);
                         AXIS2_OM_ELEMENT_SET_TEXT(fault_code_om_ele, env, text, fault_code_om_node);
-                        
+                        AXIS2_FREE((*env)->allocator, text);
                         AXIS2_OM_NODE_FREE_TREE(fault_value_om_node, env);                                                                                              
                     }
                     fault_reason = AXIS2_SOAP_FAULT_GET_REASON(soap_fault, env);
@@ -500,7 +502,7 @@
                         
                         text = AXIS2_OM_ELEMENT_GET_TEXT(fault_text_om_ele, env, fault_text_om_node);
                         AXIS2_OM_ELEMENT_SET_TEXT( fault_reason_om_ele, env, text, fault_reason_om_node);   
-                        
+                        AXIS2_FREE((*env)->allocator, text); 
                         AXIS2_OM_NODE_FREE_TREE(fault_text_om_node, env);
                     }