Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 92399 invoked from network); 7 Nov 2006 18:53:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Nov 2006 18:53:29 -0000 Received: (qmail 29991 invoked by uid 500); 7 Nov 2006 18:53:39 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 29721 invoked by uid 500); 7 Nov 2006 18:53:38 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 29710 invoked by uid 500); 7 Nov 2006 18:53:38 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 29707 invoked by uid 99); 7 Nov 2006 18:53:38 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 10:53:38 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2006 10:53:27 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id E365A1A9846; Tue, 7 Nov 2006 10:52:59 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: axis2-cvs@ws.apache.org From: dinesh@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061107185259.E365A1A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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