Fix memleaks in tests
diff --git a/test/core/clientapi/test_clientapi.cc b/test/core/clientapi/test_clientapi.cc
index 22fd193..2ff7c5d 100644
--- a/test/core/clientapi/test_clientapi.cc
+++ b/test/core/clientapi/test_clientapi.cc
@@ -136,6 +136,8 @@
         axiom_element_create(env, echo_om_node, "text", NULL, &text_om_node);
     axiom_element_set_text(text_om_ele, env, echo_text, text_om_node);
 
+    axiom_namespace_free(ns1, env);
+
     return echo_om_node;
 }
 
diff --git a/test/core/context/test_context.cc b/test/core/context/test_context.cc
index 0b6da63..1c95a9a 100644
--- a/test/core/context/test_context.cc
+++ b/test/core/context/test_context.cc
@@ -83,7 +83,7 @@
 
     conf_ctx = axis2_conf_ctx_create(m_env, conf);
     ASSERT_NE(conf_ctx, nullptr);
-	
+
     svc_grp1 = axis2_svc_grp_create(m_env);
     ASSERT_NE(svc_grp1, nullptr);
     svc_grp2 = axis2_svc_grp_create(m_env);
@@ -141,9 +141,9 @@
 
     if (svc_grp_ctx_map)
     {
-        axutil_hash_set(svc_ctx_map, "svc_grp_ctx1", AXIS2_HASH_KEY_STRING,
+        axutil_hash_set(svc_grp_ctx_map, "svc_grp_ctx1", AXIS2_HASH_KEY_STRING,
                         svc_grp_ctx1);
-        axutil_hash_set(svc_ctx_map, "svc_grp_ctx2", AXIS2_HASH_KEY_STRING,
+        axutil_hash_set(svc_grp_ctx_map, "svc_grp_ctx2", AXIS2_HASH_KEY_STRING,
                         svc_grp_ctx2);
     }
 
@@ -154,6 +154,14 @@
     CUT_ASSERT_INT_EQUAL(env->error->status_code, AXIS2_SUCCESS, 0);
     */
 
+    axutil_qname_free(qname1, m_env);
+    axutil_qname_free(qname2, m_env);
+    axis2_op_free(op, m_env);
+    axis2_svc_grp_free(svc_grp1, m_env);
+    axis2_svc_grp_free(svc_grp2, m_env);
+    axis2_svc_free(svc1, m_env);
+    axis2_svc_free(svc2, m_env);
+
     axis2_conf_ctx_free(conf_ctx, m_env);
 }
 
diff --git a/test/core/deployment/test_deployment.cc b/test/core/deployment/test_deployment.cc
index ae4f9cb..67b1fe6 100644
--- a/test/core/deployment/test_deployment.cc
+++ b/test/core/deployment/test_deployment.cc
@@ -108,7 +108,7 @@
                 void *op = NULL;
                 axis2_char_t *oname = NULL;
                 printf("ops count = %d\n", axutil_hash_count(ops));
- 
+
                 for (hi2 = axutil_hash_first(ops, m_env); hi2;
                      hi2 = axutil_hash_next(m_env, hi2))
                 {
@@ -163,6 +163,7 @@
     axutil_dll_desc_set_type(dll_desc, m_env, AXIS2_TRANSPORT_RECV_DLL);
     impl_info_param = axutil_param_create(m_env, NULL, NULL);
     axutil_param_set_value(impl_info_param, m_env, dll_desc);
+    axutil_param_set_value_free(impl_info_param, m_env, axutil_dll_desc_free_void_arg);
     axutil_class_loader_init(m_env);
     transport_recv =
         (axis2_transport_receiver_t *) axutil_class_loader_create_dll(m_env,
@@ -170,18 +171,26 @@
     ASSERT_NE(transport_recv, nullptr);
     is_running = axis2_transport_receiver_is_running(transport_recv, m_env);
     printf("is_running:%d\n", is_running);
-    AXIS2_FREE(m_env->allocator, dll_name);
     printf("transport receiver load test successful\n");
-}
 
+    /* TODO wrap this in something cleaner? */
+    DELETE_FUNCT delete_funct = axutil_dll_desc_get_delete_funct(dll_desc, m_env);
+    if (delete_funct)
+    {
+        delete_funct(transport_recv, m_env);
+    }
+
+    AXIS2_FREE(m_env->allocator, dll_name);
+    axutil_param_free(impl_info_param, m_env);
+}
 
 TEST_F(TestDeployment, test_transport_sender_load)
 {
     axutil_dll_desc_t *dll_desc = NULL;
     axis2_char_t *dll_name = NULL;
-    /*axis2_transport_sender_t *transport_sender = NULL;*/
     axutil_param_t *impl_info_param = NULL;
     axis2_char_t *axis2c_home = NULL;
+    axis2_transport_sender_t *transport_send = NULL;
 
     printf("******************************************\n");
     printf("testing axis2_transport_sender load\n");
@@ -196,12 +205,19 @@
     axutil_dll_desc_set_type(dll_desc, m_env, AXIS2_TRANSPORT_SENDER_DLL);
     impl_info_param = axutil_param_create(m_env, NULL, NULL);
     axutil_param_set_value(impl_info_param, m_env, dll_desc);
+    axutil_param_set_value_free(impl_info_param, m_env, axutil_dll_desc_free_void_arg);
     axutil_class_loader_init(m_env);
-    /*    transport_sender =
-        (axis2_transport_sender_t *) */axutil_class_loader_create_dll(m_env,
-                                                                    impl_info_param);
+    transport_send = (axis2_transport_sender_t *) axutil_class_loader_create_dll(m_env, impl_info_param);
+
+    /* TODO wrap this in something cleaner? */
+    DELETE_FUNCT delete_funct = axutil_dll_desc_get_delete_funct(dll_desc, m_env);
+    if (delete_funct)
+    {
+        delete_funct(transport_send, m_env);
+    }
 
     AXIS2_FREE(m_env->allocator, dll_name);
+    axutil_param_free(impl_info_param, m_env);
     printf("transport sender load test successful\n");
 }
 
@@ -252,6 +268,7 @@
                                                       axis2_conf_get_all_modules
                                                       (axis_conf, m_env),
                                                       axis_conf);
+
     def_mod = axis2_conf_get_default_module(axis_conf, m_env, "module1");
     ASSERT_EQ(def_mod, module1);
     def_mod = axis2_conf_get_default_module(axis_conf, m_env, "module2-0.92");
@@ -308,6 +325,7 @@
     ASSERT_NE(found1, AXIS2_FALSE);
     ASSERT_NE(found2, AXIS2_FALSE);
     ASSERT_NE(found3, AXIS2_FALSE);
+
     axis2_conf_free(axis_conf, m_env);
     ASSERT_EQ(m_env->error->status_code, AXIS2_SUCCESS);
 }
diff --git a/test/core/description/test_description.cc b/test/core/description/test_description.cc
index b0bc023..7ec721b 100644
--- a/test/core/description/test_description.cc
+++ b/test/core/description/test_description.cc
@@ -85,6 +85,9 @@
     ASSERT_EQ(m_env->error->status_code, AXIS2_SUCCESS);
 
     axis2_op_free(op, m_env);
+    axis2_conf_free(conf, m_env);
+    axis2_module_desc_free(moduleref, m_env);
+    axutil_qname_free(qname, m_env);
 }
 
 TEST_F(TestDescription, test_svc_add_module_ops)
@@ -115,6 +118,7 @@
     axis2_svc_free(svc, m_env);
     axis2_module_desc_free(module_desc, m_env);
     axis2_conf_free(axis2_config, m_env);
+    axutil_qname_free(qname, m_env);
 }
 
 TEST_F(TestDescription, test_svc_engage_module)
@@ -138,24 +142,28 @@
 
     axis2_svc_free(svc, m_env);
     axis2_conf_free(axis2_config, m_env);
+    axis2_module_desc_free(moduleref, m_env);
+    axutil_qname_free(qname, m_env);
 }
 
 TEST_F(TestDescription, test_svc_get_op)
 {
     struct axis2_svc *svc = NULL;
     struct axutil_qname *qname = NULL;
+    struct axutil_qname *qname1 = NULL;
+    struct axutil_qname *qname2 = NULL;
     struct axutil_hash_t *ops = NULL;
     struct axis2_op *op = NULL;
 
     qname = axutil_qname_create(m_env, "op1", NULL, NULL);
     op = axis2_op_create_with_qname(m_env, qname);
-    qname = axutil_qname_create(m_env, "svc1", NULL, NULL);
-    svc = axis2_svc_create_with_qname(m_env, qname);
+    qname1 = axutil_qname_create(m_env, "svc1", NULL, NULL);
+    svc = axis2_svc_create_with_qname(m_env, qname1);
 
     axis2_svc_add_op(svc, m_env, op);
 
-    qname = axutil_qname_create(m_env, "op2", NULL, NULL);
-    op = axis2_op_create_with_qname(m_env, qname);
+    qname2 = axutil_qname_create(m_env, "op2", NULL, NULL);
+    op = axis2_op_create_with_qname(m_env, qname2);
     axis2_svc_add_op(svc, m_env, op);
 
     ops = axis2_svc_get_all_ops(svc, m_env);
@@ -191,4 +199,9 @@
         printf("ops count = zero\n");
     ASSERT_EQ(m_env->error->status_code, AXIS2_SUCCESS);
 
+    axis2_svc_free(svc, m_env);
+    axutil_qname_free(qname, m_env);
+    axutil_qname_free(qname1, m_env);
+    axutil_qname_free(qname2, m_env);
+
 }
diff --git a/test/core/engine/test_engine.cc b/test/core/engine/test_engine.cc
index 3bec49c..d1b9202 100644
--- a/test/core/engine/test_engine.cc
+++ b/test/core/engine/test_engine.cc
@@ -100,6 +100,7 @@
     axis2_conf_ctx_free(conf_ctx, m_env);
     axis2_msg_ctx_free(msg_ctx, m_env);
     axutil_qname_free(qname, m_env);
+    axis2_svc_grp_free(svc_grp, m_env);
     axis2_svc_grp_ctx_free(svc_grp_ctx, m_env);
     axis2_svc_ctx_free(svc_ctx, m_env);
     axis2_svc_free(svc, m_env);
diff --git a/test/core/transport/http/test_http_transport.cc b/test/core/transport/http/test_http_transport.cc
index b95d99b..d15e4ac 100644
--- a/test/core/transport/http/test_http_transport.cc
+++ b/test/core/transport/http/test_http_transport.cc
@@ -82,6 +82,7 @@
            axis2_http_request_line_get_http_version(request_line, m_env));
 
     axis2_http_request_line_free(request_line, m_env);
+    AXIS2_FREE(m_env->allocator, request_line_str);
     printf("Finished http_request_line tests ..........\n\n");
 }
 
@@ -113,7 +114,7 @@
 {
     const char *header_name = "Content-Type";
     const char *header_value = "text/xml";
-    const char *str_header = (const char*) axutil_strdup(m_env,"Content-Type: text/xml; charset=UTF-8\r\n");
+    char *str_header = (char *)axutil_strdup(m_env,"Content-Type: text/xml; charset=UTF-8\r\n");
     axis2_http_header_t *http_header;
     axis2_char_t *external_form = NULL;
 
@@ -130,6 +131,8 @@
     axis2_http_header_free(http_header, m_env);
 
     http_header = axis2_http_header_create_by_str(m_env, str_header);
+    axis2_http_header_free(http_header, m_env);
+    AXIS2_FREE(m_env->allocator, str_header);
     printf("Finished http_header tests ..........\n\n");
 }
 
@@ -151,9 +154,10 @@
     axutil_url_free(url, m_env);
 }
 
-/* Note: This test fails unless you have a deployed axis2c instance running the
+/* Note: This test fails unless you have a deployed axis2c instance with the
  * echo service on the appropriate port, and AXIS2C_HOME defined in your
- * environment */
+ * environment.
+ */
 TEST_F(TestHTTPTransport, test_http_client)
 {
     axis2_http_client_t *client = NULL;