axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kausha...@apache.org
Subject svn commit: r448869 - in /webservices/axis2/trunk/c/rampart/src/omxmlsec: ctx.c key.c openssl/cipher_ctx.c openssl/cipher_property.c openssl/pkey.c
Date Fri, 22 Sep 2006 09:07:58 GMT
Author: kaushalye
Date: Fri Sep 22 02:07:57 2006
New Revision: 448869

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

Modified:
    webservices/axis2/trunk/c/rampart/src/omxmlsec/ctx.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/key.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/cipher_ctx.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/cipher_property.c
    webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/pkey.c

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/ctx.c?view=diff&rev=448869&r1=448868&r2=448869
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/ctx.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/ctx.c Fri Sep 22 02:07:57 2006
@@ -690,6 +690,7 @@
 {
     oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, id, AXIS2_FAILURE);
 
     ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
     if (ctx_impl->id)
@@ -697,7 +698,7 @@
         AXIS2_FREE(env->allocator, ctx_impl->id);
         ctx_impl->id = NULL;
     }
-    ctx_impl->id = id;
+    ctx_impl->id = AXIS2_STRDUP(id, env);
 
     return AXIS2_SUCCESS;
 }
@@ -711,6 +712,7 @@
 {
     oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, type, AXIS2_FAILURE);
 
     ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
     if (ctx_impl->type)
@@ -718,7 +720,7 @@
         AXIS2_FREE(env->allocator, ctx_impl->type);
         ctx_impl->type = NULL;
     }
-    ctx_impl->type = type;
+    ctx_impl->type = AXIS2_STRDUP(type, env);
 
     return AXIS2_SUCCESS;
 }
@@ -732,6 +734,7 @@
 {
     oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, mime_type, AXIS2_FAILURE);
 
     ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
     if (ctx_impl->mime_type)
@@ -739,7 +742,7 @@
         AXIS2_FREE(env->allocator, ctx_impl->mime_type);
         ctx_impl->mime_type = NULL;
     }
-    ctx_impl->mime_type = mime_type;
+    ctx_impl->mime_type = AXIS2_STRDUP(mime_type, env);
 
     return AXIS2_SUCCESS;
 }
@@ -753,6 +756,7 @@
 {
     oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, encoding, AXIS2_FAILURE);
 
     ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
     if (ctx_impl->encoding)
@@ -760,7 +764,7 @@
         AXIS2_FREE(env->allocator, ctx_impl->encoding);
         ctx_impl->encoding = NULL;
     }
-    ctx_impl->encoding = encoding;
+    ctx_impl->encoding = AXIS2_STRDUP(encoding, env);
 
     return AXIS2_SUCCESS;
 }
@@ -774,6 +778,7 @@
 {
     oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, recipient, AXIS2_FAILURE);
 
     ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
     if (ctx_impl->recipient)
@@ -781,7 +786,7 @@
         AXIS2_FREE(env->allocator, ctx_impl->recipient);
         ctx_impl->recipient = NULL;
     }
-    ctx_impl->recipient = recipient;
+    ctx_impl->recipient = AXIS2_STRDUP(recipient, env);
 
     return AXIS2_SUCCESS;
 }
@@ -795,6 +800,7 @@
 {
     oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, carried_key_name, AXIS2_FAILURE);
 
     ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
     if (ctx_impl->carried_key_name)
@@ -802,7 +808,7 @@
         AXIS2_FREE(env->allocator, ctx_impl->carried_key_name);
         ctx_impl->carried_key_name = NULL;
     }
-    ctx_impl->carried_key_name = carried_key_name;
+    ctx_impl->carried_key_name = AXIS2_STRDUP(carried_key_name, env);
 
     return AXIS2_SUCCESS;
 }
@@ -816,6 +822,7 @@
 {
     oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, enc_mtd_algorithm, AXIS2_FAILURE);
 
     ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
     if (ctx_impl->enc_mtd_algorithm)
@@ -823,7 +830,7 @@
         AXIS2_FREE(env->allocator, ctx_impl->enc_mtd_algorithm);
         ctx_impl->enc_mtd_algorithm = NULL;
     }
-    ctx_impl->enc_mtd_algorithm = enc_mtd_algorithm;
+    ctx_impl->enc_mtd_algorithm = AXIS2_STRDUP(enc_mtd_algorithm, env);
 
     return AXIS2_SUCCESS;
 }
@@ -837,6 +844,7 @@
 {
     oxs_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, input_data, AXIS2_FAILURE);
 
     ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
     if (ctx_impl->input_data)
@@ -844,7 +852,7 @@
         AXIS2_FREE(env->allocator, ctx_impl->input_data);
         ctx_impl->input_data = NULL;
     }
-    ctx_impl->input_data = input_data ;
+    ctx_impl->input_data = AXIS2_STRDUP(input_data, env) ;
 
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/key.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/key.c?view=diff&rev=448869&r1=448868&r2=448869
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/key.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/key.c Fri Sep 22 02:07:57 2006
@@ -179,6 +179,7 @@
     oxs_key_impl_t *oxs_key_impl = NULL;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, data, AXIS2_FAILURE);
     oxs_key_impl = AXIS2_INTF_TO_IMPL(key);
 
     if (oxs_key_impl->data)
@@ -186,7 +187,7 @@
         AXIS2_FREE(env->allocator, oxs_key_impl->data);
         oxs_key_impl->data = NULL;
     }
-    oxs_key_impl->data = data;
+    oxs_key_impl->data = (unsigned char *)strdup(data);
     return AXIS2_SUCCESS;
 
 }
@@ -200,6 +201,7 @@
     oxs_key_impl_t *oxs_key_impl = NULL;
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, name, AXIS2_FAILURE);
     oxs_key_impl = AXIS2_INTF_TO_IMPL(key);
 
     if (oxs_key_impl->name)
@@ -207,7 +209,7 @@
         AXIS2_FREE(env->allocator, oxs_key_impl->name);
         oxs_key_impl->name = NULL;
     }
-    oxs_key_impl->name = (axis2_char_t *)name;
+    oxs_key_impl->name = AXIS2_STRDUP(name, env);
     return AXIS2_SUCCESS;
 
 }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/cipher_ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/cipher_ctx.c?view=diff&rev=448869&r1=448868&r2=448869
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/cipher_ctx.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/cipher_ctx.c Fri Sep 22 02:07:57
2006
@@ -260,6 +260,7 @@
 {
     openssl_cipher_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, key, AXIS2_FAILURE);
 
     ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
     if (ctx_impl->key)
@@ -267,7 +268,7 @@
         AXIS2_FREE(env->allocator, ctx_impl->key);
         ctx_impl->key = NULL;
     }
-    ctx_impl->key = key;
+    ctx_impl->key = AXIS2_STRDUP(key, env);
 
     return AXIS2_SUCCESS;
 }
@@ -280,6 +281,7 @@
 {
     openssl_cipher_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, iv, AXIS2_FAILURE);
 
     ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
     if (ctx_impl->iv)
@@ -287,7 +289,7 @@
         AXIS2_FREE(env->allocator, ctx_impl->iv);
         ctx_impl->iv = NULL;
     }
-    ctx_impl->iv = iv;
+    ctx_impl->iv = AXIS2_STRDUP(iv, env);
 
     return AXIS2_SUCCESS;
 }
@@ -301,6 +303,7 @@
 {
     openssl_cipher_ctx_impl_t * ctx_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, pad, AXIS2_FAILURE);
 
     ctx_impl = AXIS2_INTF_TO_IMPL(ctx);
     if (ctx_impl->pad)
@@ -308,7 +311,7 @@
         AXIS2_FREE(env->allocator, ctx_impl->pad);
         ctx_impl->pad = NULL;
     }
-    ctx_impl->pad = pad;
+    ctx_impl->pad = AXIS2_STRDUP(pad, env);
 
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/cipher_property.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/cipher_property.c?view=diff&rev=448869&r1=448868&r2=448869
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/cipher_property.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/cipher_property.c Fri Sep 22 02:07:57
2006
@@ -216,6 +216,8 @@
 {
     openssl_cipher_property_impl_t *cprop_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, name, AXIS2_FAILURE);
+
     cprop_impl = AXIS2_INTF_TO_IMPL(cprop);
 
     if (cprop_impl->name)
@@ -223,7 +225,7 @@
         AXIS2_FREE(env->allocator, cprop_impl->name);
         cprop_impl->name = NULL;
     }
-    cprop_impl->name = name;
+    cprop_impl->name = AXIS2_STRDUP(name, env);
     return AXIS2_SUCCESS;
 }
 
@@ -235,6 +237,8 @@
 {
     openssl_cipher_property_impl_t *cprop_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, url, AXIS2_FAILURE);
+
     cprop_impl = AXIS2_INTF_TO_IMPL(cprop);
 
     if (cprop_impl->url)
@@ -242,7 +246,7 @@
         AXIS2_FREE(env->allocator, cprop_impl->url);
         cprop_impl->url = NULL;
     }
-    cprop_impl->url = url;
+    cprop_impl->url = AXIS2_STRDUP(url, env);
     return AXIS2_SUCCESS;
 }
 

Modified: webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/pkey.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/pkey.c?view=diff&rev=448869&r1=448868&r2=448869
==============================================================================
--- webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/pkey.c (original)
+++ webservices/axis2/trunk/c/rampart/src/omxmlsec/openssl/pkey.c Fri Sep 22 02:07:57 2006
@@ -249,7 +249,7 @@
 {
     openssl_pkey_impl_t * pkey_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
+    AXIS2_PARAM_CHECK(env->error, name, AXIS2_FAILURE);
     pkey_impl = AXIS2_INTF_TO_IMPL(pkey);
     if (pkey_impl->name)
     {
@@ -257,7 +257,7 @@
         pkey_impl->name = NULL;
     }
 
-    pkey_impl->name = name;
+    pkey_impl->name = AXIS2_STRDUP(name, env);
 
     return AXIS2_SUCCESS;
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message