Author: shankar
Date: Mon Apr  5 11:15:30 2010
New Revision: 930840

URL: http://svn.apache.org/viewvc?rev=930840&view=rev
Log:
Fixing memory leaks

Modified:
    axis/axis2/c/core/trunk/axiom/src/om/om_node.c
    axis/axis2/c/core/trunk/axiom/src/om/om_stax_builder.c
    axis/axis2/c/core/trunk/src/core/transport/http/util/http_transport_utils.c

Modified: axis/axis2/c/core/trunk/axiom/src/om/om_node.c
URL: 
http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/axiom/src/om/om_node.c?rev=930840&r1=930839&r2=930840&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/axiom/src/om/om_node.c (original)
+++ axis/axis2/c/core/trunk/axiom/src/om/om_node.c Mon Apr  5 11:15:30 2010
@@ -189,6 +189,12 @@ axiom_node_free_detached_subtree(
         }
     }
 
+       /* if the owner of the builder, then free the builder */
+    if(om_node->own_builder)
+    {
+        axiom_stax_builder_free_internal(om_node->builder, env);
+    }
+
     AXIS2_FREE(env->allocator, om_node);
 }
 
@@ -210,12 +216,6 @@ axiom_node_free_tree(
     /* Detach this node before freeing it and its subtree. */
     axiom_node_detach_without_namespaces(om_node, env);
 
-    /* if the owner of the builder, then free the builder */
-    if(om_node->own_builder)
-    {
-        axiom_stax_builder_free_internal(om_node->builder, env);
-    }
-
     /* Free this node and its subtree */
     axiom_node_free_detached_subtree(om_node, env);
 }

Modified: axis/axis2/c/core/trunk/axiom/src/om/om_stax_builder.c
URL: 
http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/axiom/src/om/om_stax_builder.c?rev=930840&r1=930839&r2=930840&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/axiom/src/om/om_stax_builder.c (original)
+++ axis/axis2/c/core/trunk/axiom/src/om/om_stax_builder.c Mon Apr  5 11:15:30 
2010
@@ -153,6 +153,10 @@ axiom_stax_builder_free_self(
     {
         axiom_node_assume_builder_ownership(om_builder->root_node, env);
     }
+       else
+       {
+               axiom_stax_builder_free_internal(om_builder, env);
+       }
 }
 
 /**

Modified: 
axis/axis2/c/core/trunk/src/core/transport/http/util/http_transport_utils.c
URL: 
http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/src/core/transport/http/util/http_transport_utils.c?rev=930840&r1=930839&r2=930840&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/src/core/transport/http/util/http_transport_utils.c 
(original)
+++ axis/axis2/c/core/trunk/src/core/transport/http/util/http_transport_utils.c 
Mon Apr  5 11:15:30 2010
@@ -2458,9 +2458,17 @@ axis2_http_transport_utils_dispatch_and_
 
     if(axis2_msg_ctx_get_doing_rest(msg_ctx, env))
     {
+               axis2_handler_desc_t *desc;
         rest_disp = axis2_rest_disp_create(env);
         handler = axis2_disp_get_base(rest_disp, env);
         axis2_handler_invoke(handler, env, msg_ctx);
+               axis2_disp_free(rest_disp, env);
+               desc = axis2_handler_get_handler_desc(handler, env);
+               axis2_handler_free(handler, env);
+               if(desc)
+               {
+                       axis2_handler_desc_free(desc, env);
+               }
 
         if(!axis2_msg_ctx_get_svc(msg_ctx, env) || 
!axis2_msg_ctx_get_op(msg_ctx, env))
         {


Reply via email to