Return-Path: Delivered-To: apmail-ws-axis-c-dev-archive@www.apache.org Received: (qmail 96878 invoked from network); 4 Jan 2008 05:52:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Jan 2008 05:52:58 -0000 Received: (qmail 70381 invoked by uid 500); 4 Jan 2008 05:52:47 -0000 Delivered-To: apmail-ws-axis-c-dev-archive@ws.apache.org Received: (qmail 70364 invoked by uid 500); 4 Jan 2008 05:52:47 -0000 Mailing-List: contact axis-c-dev-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Apache AXIS C Developers List" Reply-To: "Apache AXIS C Developers List" Delivered-To: mailing list axis-c-dev@ws.apache.org Received: (qmail 70353 invoked by uid 99); 4 Jan 2008 05:52:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jan 2008 21:52:47 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Jan 2008 05:52:42 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 21A10714159 for ; Thu, 3 Jan 2008 21:52:34 -0800 (PST) Message-ID: <28006297.1199425954122.JavaMail.jira@brutus> Date: Thu, 3 Jan 2008 21:52:34 -0800 (PST) From: "Senaka Fernando (JIRA)" To: axis-c-dev@ws.apache.org Subject: [jira] Commented: (AXIS2C-881) Function axis2_svc_client_remove_all_headers [Alastair FETTES] In-Reply-To: <21431926.1199420615617.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AXIS2C-881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555814#action_12555814 ] Senaka Fernando commented on AXIS2C-881: ---------------------------------------- Hi all, I think we are referring to this code block in, axis2_svc_client_fill_soap_envelope if (header_node) { int size = 0; int i = 0; size = axutil_array_list_size(svc_client->headers, env); for (i = 0; i < size; i++) { axiom_node_t *node = NULL; node = axutil_array_list_get(svc_client->headers, env, i); if (node) { axiom_node_add_child(header_node, env, node); } } } This block is leading to a dangling pointer situation. While adding nodes into the payload we have to remove it from the array_list. But, this is not happening. The suggested modification is, if (node) { axiom_node_add_child(header_node, env, node); axutil_array_list_remove(svc_client->headers, env, i); i--; size--; } Regards, Senaka > Function axis2_svc_client_remove_all_headers [Alastair FETTES] > -------------------------------------------------------------- > > Key: AXIS2C-881 > URL: https://issues.apache.org/jira/browse/AXIS2C-881 > Project: Axis2-C > Issue Type: Bug > Components: core/clientapi > Affects Versions: Current (Nightly) > Environment: Ubuntu > Reporter: Lahiru Gunathilake > Fix For: Current (Nightly) > > > > AXIS2_EXTERN > axis2_status_t axis2_svc_client_remove_all_headers( > axis2_svc_client_t* svc_client, > const axutil_env_t* env) > > This function does not take responsibility for the memory allocated to the pointers passed to it. In addition, the memory passed to the function axis2_svc_client_add_header through the parameter header is not de-allocated by this function (axis2_svc_client_remove_all_headers). This can create a possible memory leak. When in used in conjunction with a call to axis2_svc_client_send_receive_non_blocking, this is not a problem as this function will clean up the headers itself (this is assumed, since when you free the header nodes, an access violations occur when the SOAP message is sent and the calling function tries to free the SOAP message data, i.e. the header nodes). > Solution: Document memory ownership for parameters and return value. Investigate potential memory leak. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-c-dev-help@ws.apache.org