<<< Date Index >>>     <<< Thread Index >>>

Re: [PATCH] Fix memory leaks



Hi,

* Brendan Cully [06-07-06 13:37:51 -0700] wrote:

I think the first and the third are good (and I committed them). The
second one (in imap/message.c) looks bogus.

I've been talking to brendan on IRC about this one and we agree that it's bad because the 'h.data' calloc()'d at line 150 is supposed to be per header, not per folder. So this patch obviously is evil as I didn't notice that, sorry. Still valgrind(1) complains about line 150.

Brendan suggested to move the free call inside the '#ifdef HEADER_CACHE'-block as an else-part after the uid_validity check. I'll report back if that helps and provide a patch for it if it does.

As the code patch is quite deeply nested, running valgrind with --num-callers=X with X >> 4 (the default) is required (or as much as it takes to get down to libc's free()/malloc() routines).

  bye, Rocco
--
:wq!