You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2006/03/22 10:28:02 UTC

svn commit: r387807 - in /webservices/axis2/trunk/c: include/ modules/core/deployment/ modules/core/transport/http/ modules/core/transport/http/sender/ modules/mod_addr/ modules/platforms/unix/ modules/platforms/windows/ modules/util/

Author: sahan
Date: Wed Mar 22 01:28:00 2006
New Revision: 387807

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

Modified:
    webservices/axis2/trunk/c/include/axis2_stream.h
    webservices/axis2/trunk/c/modules/core/deployment/desc_builder.c
    webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c
    webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c
    webservices/axis2/trunk/c/modules/mod_addr/Makefile.am
    webservices/axis2/trunk/c/modules/platforms/unix/axis2_uuid_gen_unix.h
    webservices/axis2/trunk/c/modules/platforms/unix/uuid_gen_unix.c
    webservices/axis2/trunk/c/modules/platforms/windows/axis2_uuid_gen_windows.h
    webservices/axis2/trunk/c/modules/platforms/windows/uuid_gen_windows.c
    webservices/axis2/trunk/c/modules/util/uuid_gen.c

Modified: webservices/axis2/trunk/c/include/axis2_stream.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_stream.h?rev=387807&r1=387806&r2=387807&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_stream.h (original)
+++ webservices/axis2/trunk/c/include/axis2_stream.h Wed Mar 22 01:28:00 2006
@@ -29,7 +29,6 @@
 
 typedef struct axis2_stream axis2_stream_t;
 typedef struct axis2_stream_ops axis2_stream_ops_t;
-typedef enum axis2_stream_type axis2_stream_type_t;
 
 #define AXIS2_STREAM_DEFAULT_BUF_SIZE 512
 /**
@@ -52,6 +51,7 @@
     AXIS2_STREAM_MANAGED /* Example Wrapper stream for Apache2 read mechanism */
 };
 
+typedef enum axis2_stream_type axis2_stream_type_t;
 
 /** 
 * \brief Axis2 stream ops struct

Modified: webservices/axis2/trunk/c/modules/core/deployment/desc_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/desc_builder.c?rev=387807&r1=387806&r2=387807&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/desc_builder.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/desc_builder.c Wed Mar 22 01:28:00 2006
@@ -678,6 +678,7 @@
             if(AXIS2_SUCCESS != status)
             {
                 AXIS2_PARAM_FREE(param, env);
+                AXIS2_FREE((*env)->allocator, para_test_value);
                 return status;
             }
             AXIS2_PARAM_SET_PARAM_TYPE(param, env, AXIS2_TEXT_PARAM);

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c?rev=387807&r1=387806&r2=387807&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c Wed Mar 22 01:28:00 2006
@@ -263,6 +263,7 @@
 	AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, svc_grp_uuid);
     if(NULL != svc_grp_uuid)
     {
+
         AXIS2_FREE((*env)->allocator, svc_grp_uuid);
         svc_grp_uuid = 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=387807&r1=387806&r2=387807&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 Wed Mar 22 01:28:00 2006
@@ -465,9 +465,9 @@
 {
     axis2_char_t *so_str = NULL;
 	axis2_char_t *connection_str = NULL;
-	
-	AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     axis2_param_t *tmp_param = NULL;
+
+	AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 	
 	
     tmp_param = AXIS2_MSG_CTX_GET_PARAMETER(msg_ctx, 

Modified: webservices/axis2/trunk/c/modules/mod_addr/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/mod_addr/Makefile.am?rev=387807&r1=387806&r2=387807&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/mod_addr/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/mod_addr/Makefile.am Wed Mar 22 01:28:00 2006
@@ -7,7 +7,7 @@
                                 addr_out_handler.c \
                                 mod_addr.c
 
-libaxis2_mod_addr_la_LIBADD = 
+libaxis2_mod_addr_la_LIBADD = -laxis2_util -laxis2_om -laxis2_engine
 INCLUDES = -I$(top_builddir)/include \
             -I$(top_builddir)/modules/util \
             -I$(top_builddir)/modules/xml/parser \

Modified: webservices/axis2/trunk/c/modules/platforms/unix/axis2_uuid_gen_unix.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/platforms/unix/axis2_uuid_gen_unix.h?rev=387807&r1=387806&r2=387807&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/platforms/unix/axis2_uuid_gen_unix.h (original)
+++ webservices/axis2/trunk/c/modules/platforms/unix/axis2_uuid_gen_unix.h Wed Mar 22 01:28:00 2006
@@ -78,7 +78,7 @@
  * @return generated uuid as a string
  */ 
 axis2_char_t* AXIS2_CALL
-axis2_platform_uuid_gen();
+axis2_platform_uuid_gen(char *s);
 
 /** @} */
     

Modified: webservices/axis2/trunk/c/modules/platforms/unix/uuid_gen_unix.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/platforms/unix/uuid_gen_unix.c?rev=387807&r1=387806&r2=387807&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/platforms/unix/uuid_gen_unix.c (original)
+++ webservices/axis2/trunk/c/modules/platforms/unix/uuid_gen_unix.c Wed Mar 22 01:28:00 2006
@@ -150,19 +150,23 @@
 
 
 axis2_char_t* AXIS2_CALL
-axis2_platform_uuid_gen()
+axis2_platform_uuid_gen(char *s)
 {
 	axis2_uuid_t *uuid_struct = NULL;
 	axis2_char_t *uuid_str = NULL;
 	unsigned char mac[7];
 	char mac_hex[13];
-	
+
+    if(NULL == s)
+    {
+        return NULL;
+    }	
 	uuid_struct = axis2_uuid_gen_v1();
 	if(NULL == uuid_struct)
 	{
 		return NULL;
 	}
-	uuid_str = malloc(sizeof(axis2_char_t)*40);
+	uuid_str = s;
 	if(NULL == uuid_str)	
 	{
 		return NULL;

Modified: webservices/axis2/trunk/c/modules/platforms/windows/axis2_uuid_gen_windows.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/platforms/windows/axis2_uuid_gen_windows.h?rev=387807&r1=387806&r2=387807&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/platforms/windows/axis2_uuid_gen_windows.h (original)
+++ webservices/axis2/trunk/c/modules/platforms/windows/axis2_uuid_gen_windows.h Wed Mar 22 01:28:00 2006
@@ -30,11 +30,11 @@
   * Generate universally unique id
   * @return a char pointer to uuid
   */
-AXIS2_DECLARE(axis2_char_t *) axis2_platform_uuid_gen();
+AXIS2_DECLARE(axis2_char_t *) axis2_platform_uuid_gen(char *s);
 
 /** @} */
 #ifdef __cplusplus
 }
 #endif
 
-#endif /* AXIS2_UDDI_GEN_WINDOWS_H */
\ No newline at end of file
+#endif /* AXIS2_UDDI_GEN_WINDOWS_H */

Modified: webservices/axis2/trunk/c/modules/platforms/windows/uuid_gen_windows.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/platforms/windows/uuid_gen_windows.c?rev=387807&r1=387806&r2=387807&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/platforms/windows/uuid_gen_windows.c (original)
+++ webservices/axis2/trunk/c/modules/platforms/windows/uuid_gen_windows.c Wed Mar 22 01:28:00 2006
@@ -21,7 +21,7 @@
 #include <string.h>
 
 
-AXIS2_DECLARE(axis2_char_t *)  axis2_platform_uuid_gen()
+AXIS2_DECLARE(axis2_char_t *)  axis2_platform_uuid_gen(char *s)
 {
 	RPC_STATUS			retval;   
     UUID				uuid;
@@ -40,7 +40,7 @@
 	retval = UuidToStringA(&uuid,&str);
 	if (retval == RPC_S_OK)
 	{
-		retstr = strdup(str);
+		strcpy(retstr, str);
 		RpcStringFree(&str);
 	}
 	else if (retval == RPC_S_OUT_OF_MEMORY)
@@ -49,4 +49,4 @@
 		return NULL;
 	}
     return retstr;
-}
\ No newline at end of file
+}

Modified: webservices/axis2/trunk/c/modules/util/uuid_gen.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/uuid_gen.c?rev=387807&r1=387806&r2=387807&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/uuid_gen.c (original)
+++ webservices/axis2/trunk/c/modules/util/uuid_gen.c Wed Mar 22 01:28:00 2006
@@ -21,7 +21,9 @@
 AXIS2_DECLARE(axis2_char_t *) 
 axis2_uuid_gen(axis2_env_t **env)
 {
-	axis2_char_t *str = axis2_platform_uuid_gen();
+    
+	axis2_char_t *str = AXIS2_MALLOC((*env)->allocator, 40 * sizeof(char));
+    axis2_platform_uuid_gen(str);
 	if (str == NULL)
 	{
 		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_UUID_GEN_FAILED,