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/01/10 09:47:40 UTC

svn commit: r367526 - in /webservices/axis2/trunk/c: modules/core/context/conf_ctx.c modules/core/context/ctx.c test/core/context/test_context.c

Author: samisa
Date: Tue Jan 10 00:47:29 2006
New Revision: 367526

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

Modified:
    webservices/axis2/trunk/c/modules/core/context/conf_ctx.c
    webservices/axis2/trunk/c/modules/core/context/ctx.c
    webservices/axis2/trunk/c/test/core/context/test_context.c

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=367526&r1=367525&r2=367526&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/conf_ctx.c (original)
+++ webservices/axis2/trunk/c/modules/core/context/conf_ctx.c Tue Jan 10 00:47:29 2006
@@ -422,6 +422,12 @@
         AXIS2_FREE((*env)->allocator, conf_ctx_impl->conf_ctx.ops);
         conf_ctx_impl->conf_ctx.ops = NULL;
     }
+
+    if (conf_ctx_impl->base)
+    {
+        AXIS2_CTX_FREE(conf_ctx_impl->base, env);
+        conf_ctx_impl->base = NULL;
+    }                            
     
     if (conf_ctx_impl->op_ctx_map)
     {

Modified: webservices/axis2/trunk/c/modules/core/context/ctx.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/context/ctx.c?rev=367526&r1=367525&r2=367526&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/ctx.c (original)
+++ webservices/axis2/trunk/c/modules/core/context/ctx.c Tue Jan 10 00:47:29 2006
@@ -181,3 +181,4 @@
     
     return AXIS2_SUCCESS;
 }
+

Modified: webservices/axis2/trunk/c/test/core/context/test_context.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/core/context/test_context.c?rev=367526&r1=367525&r2=367526&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/core/context/test_context.c (original)
+++ webservices/axis2/trunk/c/test/core/context/test_context.c Tue Jan 10 00:47:29 2006
@@ -7,26 +7,30 @@
 
 int axis2_test_conf_ctx_init()
 {
-    axis2_status_t *status = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
 	axis2_allocator_t *allocator = axis2_allocator_init (NULL);
 
     axis2_env_t *env = axis2_env_create (allocator);
 
-	struct axis2_conf * axis2_config;
 	struct axis2_conf *conf = NULL;
 	conf = axis2_conf_create(&env);
 
-	struct axis2_conf_ctx *conf_ctx;
+	struct axis2_conf_ctx *conf_ctx = NULL;
 
 	conf_ctx = axis2_conf_ctx_create(&env, conf);
 
-	status = axis2_conf_ctx_init(conf_ctx, &env, conf);
+	status = AXIS2_CONF_CTX_INIT(conf_ctx, &env, conf);
 
 	if (status != AXIS2_SUCCESS)
 	{
-			printf("Error");
+			printf("ERROR %d\n", status);
 			return -1;
 	}
+    else
+        printf("SUCCESS\n");
+
+    AXIS2_CONF_CTX_FREE(conf_ctx, &env);
+    AXIS2_CONF_FREE(conf, &env);
     axis2_env_free(env);
 }