From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 8 18:11:40 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 61C8816A41F for ; Thu, 8 Sep 2005 18:11:40 +0000 (GMT) (envelope-from asmrookie@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.195]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7DC9643D55 for ; Thu, 8 Sep 2005 18:11:38 +0000 (GMT) (envelope-from asmrookie@gmail.com) Received: by zproxy.gmail.com with SMTP id z6so1060785nzd for ; Thu, 08 Sep 2005 11:11:37 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=uMDgjePpn1/VFwxFgcvm4ZwB2O0lzK19SdO2LlMbcFXgTM9ts8E9TZk3I9OjHrppqDNJmdFCfXoRRWn5QoU+M+/ki232gQvYfZ2Ufxz3XPbgBJGuHIfmRQfSGyRSMcx879joFX2+gCd2bxvFqPJfjSZzORTcl8JO2R5j1soZyLw= Received: by 10.36.100.19 with SMTP id x19mr1340676nzb; Thu, 08 Sep 2005 11:11:37 -0700 (PDT) Received: by 10.36.46.7 with HTTP; Thu, 8 Sep 2005 11:11:36 -0700 (PDT) Message-ID: <3bbf2fe1050908111118cfa6b1@mail.gmail.com> Date: Thu, 8 Sep 2005 20:11:36 +0200 From: rookie To: cole@opteqint.net In-Reply-To: <20050908125901.BDFB943D46@mx1.FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050908125901.BDFB943D46@mx1.FreeBSD.org> Cc: freebsd-hackers@freebsd.org Subject: Re: Memory Leak && Free Problem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rookie@gufi.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Sep 2005 18:11:40 -0000 > We have this section of code: > 1. new_body =3D api_filter(origin_resp_body,origin_resp_body_len); > 2. origin_resp_body_len =3D new_body->length; > 3. origin_resp_body =3D new_body->data; >=20 > I figure that the memory leak is occuring with origin_resp_body being ass= igned to the new_body > buffer. But if I try to insert a free(origin_resp_body) between line 1. a= nd 2. I get the error > "icap_srv in free(): warning: page is already free" when running the prog= ram, or either the error > "free(): warning: junk pointer, too high to make sense" Probabilly (I've not seen the whole code), since new_body and origin_resp_body points to the same chunk, memory is freed passing from new_body. greetings, rookie --=20 Peace can only be achieved by understanding - A. Einstein