Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Sep 2005 20:11:36 +0200
From:      rookie <asmrookie@gmail.com>
To:        cole@opteqint.net
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Memory Leak && Free Problem
Message-ID:  <3bbf2fe1050908111118cfa6b1@mail.gmail.com>
In-Reply-To: <20050908125901.BDFB943D46@mx1.FreeBSD.org>
References:  <20050908125901.BDFB943D46@mx1.FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3bbf2fe1050908111118cfa6b1>