axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From din...@apache.org
Subject svn commit: r472201 - in /webservices/axis2/trunk/c/axiom: include/axiom_namespace.h src/om/om_element.c src/om/om_namespace.c
Date Tue, 07 Nov 2006 18:52:59 GMT
Author: dinesh
Date: Tue Nov  7 10:52:59 2006
New Revision: 472201

URL: http://svn.apache.org/viewvc?view=rev&rev=472201
Log:
fixed axis2c-394 (patch submitted by Chris Darroch):element free segfaults if namespace reused

Modified:
    webservices/axis2/trunk/c/axiom/include/axiom_namespace.h
    webservices/axis2/trunk/c/axiom/src/om/om_element.c
    webservices/axis2/trunk/c/axiom/src/om/om_namespace.c

Modified: webservices/axis2/trunk/c/axiom/include/axiom_namespace.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/include/axiom_namespace.h?view=diff&rev=472201&r1=472200&r2=472201
==============================================================================
--- webservices/axis2/trunk/c/axiom/include/axiom_namespace.h (original)
+++ webservices/axis2/trunk/c/axiom/include/axiom_namespace.h Tue Nov  7 10:52:59 2006
@@ -130,7 +130,7 @@
     {
         /** AXIOM namespace related ops */
         axiom_namespace_ops_t *ops;
-        
+        int ref;        
     } axiom_namespace_t;
 
   /**

Modified: webservices/axis2/trunk/c/axiom/src/om/om_element.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_element.c?view=diff&rev=472201&r1=472200&r2=472201
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_element.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_element.c Tue Nov  7 10:52:59 2006
@@ -685,6 +685,7 @@
         axis2_hash_set(om_ele_impl->namespaces, key,
                 AXIS2_HASH_KEY_STRING,  ns);
     }
+    ++ns->ref;
 
     return AXIS2_SUCCESS;
 }
@@ -1590,6 +1591,7 @@
 
     axis2_hash_set(om_ele_impl->namespaces, "",
             AXIS2_HASH_KEY_STRING, default_ns);
+    ++default_ns->ref;
     return default_ns;
 }
 

Modified: webservices/axis2/trunk/c/axiom/src/om/om_namespace.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_namespace.c?view=diff&rev=472201&r1=472200&r2=472201
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_namespace.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_namespace.c Tue Nov  7 10:52:59 2006
@@ -107,6 +107,7 @@
 
 
     ns->om_namespace.ops = NULL;
+    ns->om_namespace.ref = 0;
     ns->prefix = NULL;
     ns->uri = NULL;
     ns->key = NULL;
@@ -175,6 +176,12 @@
 {
     axiom_namespace_impl_t *ns_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    if (--om_namespace->ref > 0)
+    {
+        return AXIS2_SUCCESS;
+    }
+
     ns_impl = AXIS2_INTF_TO_IMPL(om_namespace);
 
     if (ns_impl->prefix)



---------------------------------------------------------------------
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