Memory Leak && Free Problem

rookie asmrookie at gmail.com
Thu Sep 8 11:11:40 PDT 2005


> We have this section of code:
> 1.   new_body = api_filter(origin_resp_body,origin_resp_body_len);
> 2.   origin_resp_body_len = new_body->length;
> 3.   origin_resp_body = new_body->data;
> 
> I figure that the memory leak is occuring with origin_resp_body being assigned to the new_body
> buffer. But if I try to insert a free(origin_resp_body) between line 1. and 2. I get the error
> "icap_srv in free(): warning: page is already free" when running the program, 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


-- 
Peace can only be achieved by understanding - A. Einstein


More information about the freebsd-hackers mailing list