axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manj...@apache.org
Subject svn commit: r555520 - in /webservices/axis2/trunk/c/neethi/src: assertion.c policy.c secpolicy/model/property.c secpolicy/model/secpolicy.c
Date Thu, 12 Jul 2007 07:58:32 GMT
Author: manjula
Date: Thu Jul 12 00:58:31 2007
New Revision: 555520

URL: http://svn.apache.org/viewvc?view=rev&rev=555520
Log:
Fixing tme memory leaks using ref count.

Modified:
    webservices/axis2/trunk/c/neethi/src/assertion.c
    webservices/axis2/trunk/c/neethi/src/policy.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/model/property.c
    webservices/axis2/trunk/c/neethi/src/secpolicy/model/secpolicy.c

Modified: webservices/axis2/trunk/c/neethi/src/assertion.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/assertion.c?view=diff&rev=555520&r1=555519&r2=555520
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/assertion.c (original)
+++ webservices/axis2/trunk/c/neethi/src/assertion.c Thu Jul 12 00:58:31 2007
@@ -25,6 +25,9 @@
 #include <rp_wss10.h>
 #include <rp_supporting_tokens.h>
 #include <rp_username_token.h>
+#include <rp_asymmetric_binding.h>
+#include <rp_rampart_config.h>
+#include <rp_signed_encrypted_parts.h>
 
 struct neethi_assertion_t
 {
@@ -133,6 +136,18 @@
         rp_username_token_increment_ref((rp_username_token_t *)value, env);
     }
 
+    if(type == ASSERTION_TYPE_ASSYMMETRIC_BINDING)
+    {
+        rp_asymmetric_binding_increment_ref((rp_asymmetric_binding_t *)value, env);
+    }    
+    if(type == ASSERTION_TYPE_SIGNED_ENCRYPTED_PARTS)
+    {
+        rp_signed_encrypted_parts_increment_ref((rp_signed_encrypted_parts_t *)value, env);
+    }
+    if(type == ASSERTION_TYPE_RAMPART_CONFIG)
+    {
+        rp_rampart_config_increment_ref((rp_rampart_config_t *)value, env);
+    }
     neethi_assertion->value = value;
     neethi_assertion->type = type;
     neethi_assertion->element = NULL;

Modified: webservices/axis2/trunk/c/neethi/src/policy.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/policy.c?view=diff&rev=555520&r1=555519&r2=555520
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/policy.c (original)
+++ webservices/axis2/trunk/c/neethi/src/policy.c Thu Jul 12 00:58:31 2007
@@ -95,6 +95,16 @@
             axutil_array_list_free(neethi_policy->policy_components , env);
             neethi_policy->policy_components = NULL;
         }
+        if(neethi_policy->id)
+        {
+            AXIS2_FREE(env->allocator, neethi_policy->id);
+            neethi_policy->id = NULL;
+        }   
+        if(neethi_policy->name)
+        {
+            AXIS2_FREE(env->allocator, neethi_policy->name);
+            neethi_policy->name = NULL;
+        }    
         AXIS2_FREE(env->allocator, neethi_policy);
         neethi_policy = NULL;
     }

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/model/property.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/model/property.c?view=diff&rev=555520&r1=555519&r2=555520
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/model/property.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/model/property.c Thu Jul 12 00:58:31 2007
@@ -172,8 +172,19 @@
     if(type == RP_SUPPORTING_SIGNED_SUPPORTING)
     {
         rp_supporting_tokens_increment_ref((rp_supporting_tokens_t *)value, env);
+    }
+    if(type == RP_BINDING_ASYMMETRIC)
+    {
+        rp_asymmetric_binding_increment_ref((rp_asymmetric_binding_t *)value, env);
+    }
+    if(type == RP_BINDING_TRANSPORT)
+    {
+        rp_transport_binding_increment_ref((rp_transport_binding_t *)value, env);
+    }    
+    if(type == RP_BINDING_SYMMETRIC)
+    {
+        rp_symmetric_binding_increment_ref((rp_symmetric_binding_t *)value, env);
     }    
-
     property->value =(void *)value; 
 
     return AXIS2_SUCCESS;

Modified: webservices/axis2/trunk/c/neethi/src/secpolicy/model/secpolicy.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/secpolicy/model/secpolicy.c?view=diff&rev=555520&r1=555519&r2=555520
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/secpolicy/model/secpolicy.c (original)
+++ webservices/axis2/trunk/c/neethi/src/secpolicy/model/secpolicy.c Thu Jul 12 00:58:31 2007
@@ -80,70 +80,70 @@
     {
         if(secpolicy->binding)
         {
-            rp_property_free(secpolicy->binding,env);
+            rp_property_free(secpolicy->binding, env);
             secpolicy->binding = NULL;
         }
         if(secpolicy->wss)
         {
-            rp_property_free(secpolicy->wss,env);            
+            rp_property_free(secpolicy->wss, env);            
             secpolicy->wss = NULL;
         }
         if(secpolicy->supporting_tokens)
         {
-            rp_supporting_tokens_free(secpolicy->supporting_tokens,env);
+            rp_supporting_tokens_free(secpolicy->supporting_tokens, env);
             secpolicy->supporting_tokens = NULL;
         }
         if(secpolicy->signed_supporting_tokens)
         {
-            rp_supporting_tokens_free(secpolicy->signed_supporting_tokens,env);
+            rp_supporting_tokens_free(secpolicy->signed_supporting_tokens, env);
             secpolicy->signed_supporting_tokens = NULL;
         }
         if(secpolicy->endorsing_supporting_tokens)
         {
-            rp_supporting_tokens_free(secpolicy->endorsing_supporting_tokens,env);
+            rp_supporting_tokens_free(secpolicy->endorsing_supporting_tokens, env);
             secpolicy->endorsing_supporting_tokens = NULL;
         }
         if(secpolicy->signed_endorsing_supporting_tokens)
         {
-            rp_supporting_tokens_free(secpolicy->signed_endorsing_supporting_tokens,env);
+            rp_supporting_tokens_free(secpolicy->signed_endorsing_supporting_tokens, env);
             secpolicy->signed_endorsing_supporting_tokens = NULL;
         }
         if(secpolicy->signed_parts)
         {
-            rp_signed_encrypted_parts_free(secpolicy->signed_parts,env);
+            rp_signed_encrypted_parts_free(secpolicy->signed_parts, env);
             secpolicy->signed_parts = NULL;
         }
         if(secpolicy->encrypted_parts)
         {
-            rp_signed_encrypted_parts_free(secpolicy->encrypted_parts,env);
+            rp_signed_encrypted_parts_free(secpolicy->encrypted_parts, env);
             secpolicy->encrypted_parts = NULL;
         }            
         if(secpolicy->signed_elements)
         {
-            rp_signed_encrypted_elements_free(secpolicy->signed_elements,env);
+            rp_signed_encrypted_elements_free(secpolicy->signed_elements, env);
             secpolicy->signed_elements = NULL;
         }            
         if(secpolicy->encrypted_elements)
         {
-            rp_signed_encrypted_elements_free(secpolicy->encrypted_elements,env);
+            rp_signed_encrypted_elements_free(secpolicy->encrypted_elements, env);
             secpolicy->encrypted_elements = NULL;
         }
         if(secpolicy->signed_items)
         {
-            rp_signed_encrypted_items_free(secpolicy->signed_items,env);
+            rp_signed_encrypted_items_free(secpolicy->signed_items, env);
             secpolicy->signed_items = NULL;
         }            
         if(secpolicy->encrypted_items)
         {
-            rp_signed_encrypted_items_free(secpolicy->encrypted_items,env);
+            rp_signed_encrypted_items_free(secpolicy->encrypted_items, env);
             secpolicy->encrypted_items = NULL;
         }
         if(secpolicy->rampart_config)
         {
-            rp_rampart_config_free(secpolicy->rampart_config,env);
+            rp_rampart_config_free(secpolicy->rampart_config, env);
             secpolicy->rampart_config = NULL;
         }            
-        AXIS2_FREE(env->allocator,secpolicy);           
+        AXIS2_FREE(env->allocator, secpolicy);           
     }
 
     return;
@@ -168,8 +168,8 @@
     rp_property_t *binding)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error,binding,AXIS2_FAILURE);
-    
+    AXIS2_PARAM_CHECK(env->error, binding, AXIS2_FAILURE);
+    rp_property_increment_ref(binding, env);
     secpolicy->binding = binding; 
     return AXIS2_SUCCESS;
 }
@@ -182,7 +182,8 @@
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error,supporting_tokens,AXIS2_FAILURE);
-    
+   
+    rp_supporting_tokens_increment_ref(supporting_tokens, env);
     secpolicy->supporting_tokens = supporting_tokens; 
     return AXIS2_SUCCESS;
 }
@@ -206,6 +207,7 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error,signed_supporting_tokens,AXIS2_FAILURE);
     
+    rp_supporting_tokens_increment_ref(signed_supporting_tokens, env);
     secpolicy->signed_supporting_tokens = signed_supporting_tokens; 
     return AXIS2_SUCCESS;
 }
@@ -227,8 +229,9 @@
     rp_supporting_tokens_t *endorsing_supporting_tokens)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error,endorsing_supporting_tokens,AXIS2_FAILURE);   
+    AXIS2_PARAM_CHECK(env->error, endorsing_supporting_tokens, AXIS2_FAILURE);   
     
+    rp_supporting_tokens_increment_ref(endorsing_supporting_tokens, env);
     secpolicy->endorsing_supporting_tokens = endorsing_supporting_tokens; 
     return AXIS2_SUCCESS;
 }
@@ -250,8 +253,9 @@
     rp_supporting_tokens_t *signed_endorsing_supporting_tokens)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error,signed_endorsing_supporting_tokens,AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, signed_endorsing_supporting_tokens, AXIS2_FAILURE);
 
+    rp_supporting_tokens_increment_ref(signed_endorsing_supporting_tokens, env);
     secpolicy->signed_endorsing_supporting_tokens = signed_endorsing_supporting_tokens;

     return AXIS2_SUCCESS;
 }
@@ -273,7 +277,8 @@
     rp_signed_encrypted_parts_t *signed_parts)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error,signed_parts,AXIS2_FAILURE);    
+    AXIS2_PARAM_CHECK(env->error, signed_parts, AXIS2_FAILURE);    
+    rp_signed_encrypted_parts_increment_ref(signed_parts, env);
     secpolicy->signed_parts = signed_parts; 
 
     return AXIS2_SUCCESS;
@@ -297,8 +302,9 @@
     rp_signed_encrypted_parts_t *encrypted_parts)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error,encrypted_parts,AXIS2_FAILURE);    
+    AXIS2_PARAM_CHECK(env->error, encrypted_parts, AXIS2_FAILURE);    
 
+    rp_signed_encrypted_parts_increment_ref(encrypted_parts, env);
     secpolicy->encrypted_parts = encrypted_parts; 
     return AXIS2_SUCCESS;
     
@@ -321,8 +327,9 @@
     rp_signed_encrypted_elements_t *signed_elements)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error,signed_elements,AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, signed_elements, AXIS2_FAILURE);
 
+    rp_signed_encrypted_elements_increment_ref(signed_elements, env);
     secpolicy->signed_elements = signed_elements; 
     return AXIS2_SUCCESS;
     
@@ -345,8 +352,9 @@
     rp_signed_encrypted_elements_t *encrypted_elements)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error,encrypted_elements,AXIS2_FAILURE);   
+    AXIS2_PARAM_CHECK(env->error, encrypted_elements, AXIS2_FAILURE);   
 
+    rp_signed_encrypted_elements_increment_ref(encrypted_elements, env);
     secpolicy->encrypted_elements = encrypted_elements; 
     return AXIS2_SUCCESS;
 }
@@ -415,8 +423,9 @@
     rp_property_t *wss)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error,wss,AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, wss, AXIS2_FAILURE);
     
+    rp_property_increment_ref(wss, env);
     secpolicy->wss = wss; 
     return AXIS2_SUCCESS;
 }
@@ -438,8 +447,9 @@
     rp_rampart_config_t *rampart_config)
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error,rampart_config,AXIS2_FAILURE);   
+    AXIS2_PARAM_CHECK(env->error, rampart_config, AXIS2_FAILURE);   
     
+    rp_rampart_config_increment_ref(rampart_config, env);
     secpolicy->rampart_config = rampart_config; 
     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