You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2006/11/07 19:52:59 UTC
svn commit: r472201 - in /webservices/axis2/trunk/c/axiom:
include/axiom_namespace.h src/om/om_element.c src/om/om_namespace.c
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