On Tue, February 28, 2006 4:59 pm, Aaron Stone wrote:
> On Tue, Feb 28, 2006, Leif Jackson <[EMAIL PROTECTED]> said:
>
>
>> Guys before 2.1.4 rel, what about that memory leak issue in imapd?, did
>>  you find a workaround? This is the malloc for () keys in the command
>> parser I am talking about.
>
> Oh. Hrmm... I'll try to take a look at it tonight. I think the
> lazy/stupid approach will be to change that global the_args array to be a
> static variable inside of the build_args function. Every time the function
> is called, it will reap the memory from the previous call. Exactly the
> same fix you made for db_query ;-)

That was the issue, you can't reap/free the memory for each allocation
because you loose the pointer refernece, it leaks because when the
the_args array is free'ed after use you only free the ref to the main
allocation. I belive the correct solution would be to change it to a
resizeing realloc or somthing of that nature so that when freeing the
allocated args it free's all the memory in the buffer because it was
realloced each time to point to the whole thing...etc.

-leif


>
> Aaron
> _______________________________________________
> Dbmail-dev mailing list
> [email protected]
> http://twister.fastxs.net/mailman/listinfo/dbmail-dev
>
>


Reply via email to