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 ma...@apache.org on 2008/08/05 07:05:21 UTC

svn commit: r682581 - /webservices/axis2/trunk/c/neethi/test/test.c

Author: manjula
Date: Mon Aug  4 22:05:21 2008
New Revision: 682581

URL: http://svn.apache.org/viewvc?rev=682581&view=rev
Log:
Fixing some memory leaks in tests.

Modified:
    webservices/axis2/trunk/c/neethi/test/test.c

Modified: webservices/axis2/trunk/c/neethi/test/test.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/test/test.c?rev=682581&r1=682580&r2=682581&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/test/test.c (original)
+++ webservices/axis2/trunk/c/neethi/test/test.c Mon Aug  4 22:05:21 2008
@@ -17,16 +17,18 @@
     int argc,
     char **argv)
 {
-    axutil_allocator_t *allocator = axutil_allocator_init(NULL);
+    /*axutil_allocator_t *allocator = axutil_allocator_init(NULL);
     axutil_error_t *error = axutil_error_create(allocator);
-    const axutil_env_t *env = axutil_env_create_with_error(allocator, error);
-
+    const axutil_env_t *env = axutil_env_create_with_error(allocator, error);*/
+    const axutil_env_t *env = NULL;
     axiom_xml_reader_t *reader = NULL;
     axiom_stax_builder_t *builder = NULL;
     axiom_document_t *document = NULL;
     axiom_node_t *root = NULL;
     axiom_element_t *root_ele = NULL;
 
+    env = axutil_env_create_all("test.log", AXIS2_LOG_LEVEL_TRACE);
+
     reader = axiom_xml_reader_create_for_file(env, argv[1], NULL);
 
     if (!reader)
@@ -113,6 +115,15 @@
         }
     }
 
+    if(builder)
+    {
+        axiom_stax_builder_free(builder, env);
+        builder = NULL;
+    }
+
+    axutil_env_free((axutil_env_t *)env);
+    env = NULL;    
+
     printf("Successful\n");
     return 0;