Return-Path: X-Original-To: apmail-axis-c-dev-archive@www.apache.org Delivered-To: apmail-axis-c-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4915211587 for ; Fri, 21 Feb 2014 16:38:37 +0000 (UTC) Received: (qmail 41586 invoked by uid 500); 21 Feb 2014 16:38:23 -0000 Delivered-To: apmail-axis-c-dev-archive@axis.apache.org Received: (qmail 41414 invoked by uid 500); 21 Feb 2014 16:38:21 -0000 Mailing-List: contact c-dev-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache AXIS C Developers List" Delivered-To: mailing list c-dev@axis.apache.org Received: (qmail 41393 invoked by uid 99); 21 Feb 2014 16:38:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Feb 2014 16:38:20 +0000 Date: Fri, 21 Feb 2014 16:38:19 +0000 (UTC) From: "Seth McCarus (JIRA)" To: c-dev@axis.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (AXIS2C-1664) Memory leak when replacing value of item in hash table MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Seth McCarus created AXIS2C-1664: ------------------------------------ Summary: Memory leak when replacing value of item in hash table Key: AXIS2C-1664 URL: https://issues.apache.org/jira/browse/AXIS2C-1664 Project: Axis2-C Issue Type: Bug Components: core/transport Affects Versions: 1.6.0 Environment: Windows 7 Reporter: Seth McCarus Fix For: Next Version axis2_libcurl_send() in axis2c\src\core\transport\http\sender\libcurl\axis2_libcurl.c has this call: axis2_transport_in_desc_add_param(transport_in, env, param_expose_http_headers); this has the effect of replacing the existing "exposeHeaders" parameter in the http transport_in object with a new parameter of the same name. axis2_transport_in_desc_add_param() calls axutil_param_container_add_param(), which calls axutil_hash_set() to replace the param in the hash table. axutil_hash_set has this code: /* replace entry */ (*hep)->val = val; /* check that the collision rate isn't too high */ if(ht->count > ht->max) { axutil_hash_expand_array(ht); } however the original "val" is not freed, so the existing parameter is leaked. the proper fix would be to delete val before replacing it, but I'm not sure how that could be done (in my limited knowledge of Axis). my fix was to delete the exposeHeaders param in axis2_transport_in_desc_add_param by calling axutil_param_container_delete_param before calling axutil_param_container_add_param, but this fixes only the specific case, and not other cases of hash table leaks. -- This message was sent by Atlassian JIRA (v6.1.5#6160) --------------------------------------------------------------------- To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org For additional commands, e-mail: c-dev-help@axis.apache.org