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 sa...@apache.org on 2006/03/23 12:09:20 UTC

svn commit: r388143 - in /webservices/axis2/trunk/c/modules/core: clientapi/mep_client.c context/conf_ctx.c transport/http/sender/soap_over_http_sender.c

Author: samisa
Date: Thu Mar 23 03:09:11 2006
New Revision: 388143

URL: http://svn.apache.org/viewcvs?rev=388143&view=rev
Log:
Fixed more memory leaks and fixed seg faults

Modified:
    webservices/axis2/trunk/c/modules/core/clientapi/mep_client.c
    webservices/axis2/trunk/c/modules/core/context/conf_ctx.c
    webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c

Modified: webservices/axis2/trunk/c/modules/core/clientapi/mep_client.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/clientapi/mep_client.c?rev=388143&r1=388142&r2=388143&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/mep_client.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/mep_client.c Thu Mar 23 03:09:11 2006
@@ -542,11 +542,11 @@
     if (!response)
         return NULL;
     
-    property = AXIS2_MSG_CTX_GET_PROPERTY(msg_ctx, env, AXIS2_TRANSPORT_IN, AXIS2_TRUE);
+    property = AXIS2_MSG_CTX_GET_PROPERTY(msg_ctx, env, AXIS2_TRANSPORT_IN, AXIS2_FALSE);
     if(property)
     {
         AXIS2_MSG_CTX_SET_PROPERTY(response, env, AXIS2_TRANSPORT_IN, property,
-            AXIS2_TRUE);
+            AXIS2_FALSE);
         property = NULL;
     }
     
@@ -584,6 +584,11 @@
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_BLOCKING_INVOCATION_EXPECTS_RESPONSE, AXIS2_FAILURE);
         return NULL;
     }
+        
+    /* property is NULL, and we set null for AXIS2_TRANSPORT_IN in msg_ctx to
+    avoid double free of this property */
+    AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, AXIS2_TRANSPORT_IN, property,
+            AXIS2_FALSE);
     
     if(NULL != engine)
     {

Modified: webservices/axis2/trunk/c/modules/core/context/conf_ctx.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/context/conf_ctx.c?rev=388143&r1=388142&r2=388143&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/conf_ctx.c (original)
+++ webservices/axis2/trunk/c/modules/core/context/conf_ctx.c Thu Mar 23 03:09:11 2006
@@ -466,18 +466,63 @@
     
     if (conf_ctx_impl->op_ctx_map)
     {
+        axis2_hash_index_t *hi = NULL;
+        void *val = NULL;
+        for (hi = axis2_hash_first (conf_ctx_impl->op_ctx_map, env); hi;
+                 hi = axis2_hash_next ( env, hi))
+        {
+            axis2_op_ctx_t *op_ctx = NULL;
+            axis2_hash_this (hi, NULL, NULL, &val);
+            op_ctx = (axis2_op_ctx_t *) val;
+            if (op_ctx)
+               AXIS2_OP_CTX_FREE (op_ctx, env);
+            
+            val = NULL;
+            op_ctx = NULL;
+               
+        }
         axis2_hash_free(conf_ctx_impl->op_ctx_map, env);
         conf_ctx_impl->op_ctx_map = NULL;
     }    
     
     if (conf_ctx_impl->svc_ctx_map)
     {
+        axis2_hash_index_t *hi = NULL;
+        void *val = NULL;
+        for (hi = axis2_hash_first (conf_ctx_impl->svc_ctx_map, env); hi;
+                 hi = axis2_hash_next ( env, hi))
+        {
+            axis2_svc_ctx_t *svc_ctx = NULL;
+            axis2_hash_this (hi, NULL, NULL, &val);
+            svc_ctx = (axis2_svc_ctx_t *) val;
+            if (svc_ctx)
+               AXIS2_SVC_CTX_FREE (svc_ctx, env);
+            
+            val = NULL;
+            svc_ctx = NULL;
+               
+        }
         axis2_hash_free(conf_ctx_impl->svc_ctx_map, env);
         conf_ctx_impl->svc_ctx_map = NULL;
     }    
     
     if (conf_ctx_impl->svc_grp_ctx_map)
     {
+        axis2_hash_index_t *hi = NULL;
+        void *val = NULL;
+        for (hi = axis2_hash_first (conf_ctx_impl->svc_grp_ctx_map, env); hi;
+                 hi = axis2_hash_next ( env, hi))
+        {
+            axis2_svc_grp_ctx_t *svc_grp_ctx = NULL;
+            axis2_hash_this (hi, NULL, NULL, &val);
+            svc_grp_ctx = (axis2_svc_grp_ctx_t *) val;
+            if (svc_grp_ctx)
+               AXIS2_SVC_GRP_CTX_FREE (svc_grp_ctx, env);
+            
+            val = NULL;
+            svc_grp_ctx = NULL;
+               
+        }
         axis2_hash_free(conf_ctx_impl->svc_grp_ctx_map, env);
         conf_ctx_impl->svc_grp_ctx_map = NULL;
     }

Modified: webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c?rev=388143&r1=388142&r2=388143&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c Thu Mar 23 03:09:11 2006
@@ -457,13 +457,15 @@
 	}
 	
 	axis2_soap_over_http_sender_get_header_info(sender, env, msg_ctx, response);
-	axis_ctx = AXIS2_OP_CTX_GET_BASE(AXIS2_MSG_CTX_GET_OP_CTX(msg_ctx, env), 
-						env);
+	/*axis_ctx = AXIS2_OP_CTX_GET_BASE(AXIS2_MSG_CTX_GET_OP_CTX(msg_ctx, env), 
+						env);*/
     property = axis2_property_create(env);
     AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_REQUEST);
     AXIS2_PROPERTY_SET_FREE_FUNC(property, env, axis2_stream_free_void_arg);
     AXIS2_PROPERTY_SET_VALUE(property, env, in_stream);
-	AXIS2_CTX_SET_PROPERTY(axis_ctx, env, AXIS2_TRANSPORT_IN, property, 
+	/*AXIS2_CTX_SET_PROPERTY(axis_ctx, env, AXIS2_TRANSPORT_IN, property, 
+						AXIS2_FALSE);*/
+	AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, AXIS2_TRANSPORT_IN, property, 
 						AXIS2_FALSE);
 	return AXIS2_SUCCESS;
 }