axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manj...@apache.org
Subject svn commit: r544473 - in /webservices/axis2/trunk/c/neethi: include/neethi_operator.h src/engine.c src/operator.c
Date Tue, 05 Jun 2007 12:44:02 GMT
Author: manjula
Date: Tue Jun  5 05:44:01 2007
New Revision: 544473

URL: http://svn.apache.org/viewvc?view=rev&rev=544473
Log:
Fixing some memory leaks due to neethi_operator create.

Modified:
    webservices/axis2/trunk/c/neethi/include/neethi_operator.h
    webservices/axis2/trunk/c/neethi/src/engine.c
    webservices/axis2/trunk/c/neethi/src/operator.c

Modified: webservices/axis2/trunk/c/neethi/include/neethi_operator.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/include/neethi_operator.h?view=diff&rev=544473&r1=544472&r2=544473
==============================================================================
--- webservices/axis2/trunk/c/neethi/include/neethi_operator.h (original)
+++ webservices/axis2/trunk/c/neethi/include/neethi_operator.h Tue Jun  5 05:44:01 2007
@@ -74,6 +74,11 @@
             neethi_operator_t *neethi_operator,
             const axutil_env_t *env,
             axiom_node_t *parent);
+   
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    neethi_operator_set_value_null(
+            neethi_operator_t *neethi_operator,
+            const axutil_env_t *env);
     
 
 

Modified: webservices/axis2/trunk/c/neethi/src/engine.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/engine.c?view=diff&rev=544473&r1=544472&r2=544473
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/engine.c (original)
+++ webservices/axis2/trunk/c/neethi/src/engine.c Tue Jun  5 05:44:01 2007
@@ -119,6 +119,11 @@
     neethi_operator_set_value(neethi_operator,env,all,OPERATOR_TYPE_ALL);
     process_operation_element(env,neethi_operator,node,element);
 
+    neethi_operator_set_value_null(neethi_operator, env);
+
+    neethi_operator_free(neethi_operator, env);
+    neethi_operator = NULL;
+    
     return all;
 }   
 
@@ -144,6 +149,11 @@
     neethi_operator_set_value(neethi_operator,env,exactlyone,OPERATOR_TYPE_EXACTLYONE);
     process_operation_element(env,neethi_operator,node,element);
 
+    neethi_operator_set_value_null(neethi_operator, env);
+
+    neethi_operator_free(neethi_operator, env);
+    neethi_operator = NULL;
+
     return exactlyone;
 }
 
@@ -199,7 +209,12 @@
         return NULL;
     }        
     neethi_operator_set_value(neethi_operator,env,neethi_policy,OPERATOR_TYPE_POLICY);
-    process_operation_element(env,neethi_operator,node,element);    
+    process_operation_element(env,neethi_operator,node,element);  
+
+    neethi_operator_set_value_null(neethi_operator, env);
+    
+    neethi_operator_free(neethi_operator, env);
+    neethi_operator = NULL;
 
     return neethi_policy;
 }
@@ -323,7 +338,6 @@
                             operator = neethi_operator_create(env);
                             neethi_operator_set_value(operator, env, assertion, OPERATOR_TYPE_ASSERTION);
                             neethi_engine_add_policy_component(env,neethi_operator,operator);
-                            
                         }                            
                     }
                 }
@@ -466,6 +480,11 @@
     neethi_operator_set_value(operator,env,neethi_policy,OPERATOR_TYPE_POLICY);
 
     exactlyone = normalize_operator(operator,registry,deep,env);
+
+    neethi_operator_set_value_null(operator, env);
+
+    neethi_operator_free(operator, env);
+    operator = NULL;
 
     if(exactlyone)
     {

Modified: webservices/axis2/trunk/c/neethi/src/operator.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/operator.c?view=diff&rev=544473&r1=544472&r2=544473
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/operator.c (original)
+++ webservices/axis2/trunk/c/neethi/src/operator.c Tue Jun  5 05:44:01 2007
@@ -92,8 +92,9 @@
                 case OPERATOR_TYPE_UNKNOWN:
                     break;
             }
-            AXIS2_FREE(env->allocator,neethi_operator->value);     
-        }            
+            /*AXIS2_FREE(env->allocator,neethi_operator->value);*/     
+        }
+        AXIS2_FREE(env->allocator, neethi_operator);
     }
     return; 
 }
@@ -190,3 +191,13 @@
     }
     else return AXIS2_FAILURE;
 }
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+neethi_operator_set_value_null(
+    neethi_operator_t *neethi_operator,
+    const axutil_env_t *env)
+{
+    neethi_operator->value = NULL;
+    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