ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manj...@apache.org
Subject svn commit: r681639 - in /webservices/axis2/trunk/c/neethi: src/policy.c test/policies/symmetric_binding_policy.xml
Date Fri, 01 Aug 2008 09:50:56 GMT
Author: manjula
Date: Fri Aug  1 02:50:55 2008
New Revision: 681639

URL: http://svn.apache.org/viewvc?rev=681639&view=rev
Log:
Fixing some bugs due to inappropriate memory frees.

Modified:
    webservices/axis2/trunk/c/neethi/src/policy.c
    webservices/axis2/trunk/c/neethi/test/policies/symmetric_binding_policy.xml

Modified: webservices/axis2/trunk/c/neethi/src/policy.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/src/policy.c?rev=681639&r1=681638&r2=681639&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/src/policy.c (original)
+++ webservices/axis2/trunk/c/neethi/src/policy.c Fri Aug  1 02:50:55 2008
@@ -252,6 +252,7 @@
     if(neethi_policy->attributes)
     {
         axutil_qname_t *qname = NULL;
+        axis2_char_t *name = NULL;
         qname = axutil_qname_create(env, NEETHI_NAME, NULL, NULL);
 
         if(qname)
@@ -259,13 +260,12 @@
             axis2_char_t *key = axutil_qname_to_string(qname, env);
             if(key)
             {
-                return (axis2_char_t *)axutil_hash_get(neethi_policy->attributes, key,

+                name = (axis2_char_t *)axutil_hash_get(neethi_policy->attributes, key,

                     AXIS2_HASH_KEY_STRING);
             }
-            else
-            {
-                return NULL;
-            }
+            axutil_qname_free(qname, env);
+            qname = NULL;
+            return name;
         }        
         else
         {
@@ -330,7 +330,7 @@
         key = axutil_qname_to_string(qname, env);
         if(key)
         {
-            axutil_hash_set(neethi_policy->attributes, key, 
+            axutil_hash_set(neethi_policy->attributes, axutil_strdup(env, key), 
                 AXIS2_HASH_KEY_STRING, axutil_strdup(env, id));
         }
         axutil_qname_free(qname, env);
@@ -359,7 +359,7 @@
         key = axutil_qname_to_string(qname, env);
         if(key)
         {
-            axutil_hash_set(neethi_policy->attributes, key, 
+            axutil_hash_set(neethi_policy->attributes, axutil_strdup(env, key), 
                 AXIS2_HASH_KEY_STRING, axutil_strdup(env, name));
         }
         axutil_qname_free(qname, env);

Modified: webservices/axis2/trunk/c/neethi/test/policies/symmetric_binding_policy.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/neethi/test/policies/symmetric_binding_policy.xml?rev=681639&r1=681638&r2=681639&view=diff
==============================================================================
--- webservices/axis2/trunk/c/neethi/test/policies/symmetric_binding_policy.xml (original)
+++ webservices/axis2/trunk/c/neethi/test/policies/symmetric_binding_policy.xml Fri Aug  1
02:50:55 2008
@@ -1,4 +1,4 @@
-<wsp:Policy wsu:Id="SymmetricKeyPolicy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
     <wsp:ExactlyOne>
         <wsp:All>
            <sp:SymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">



Mime
View raw message