|
From: | Jon Grant |
Subject: | Re: possible memory leak in make 3.81 |
Date: | Sun, 14 Oct 2007 18:33:10 +0100 |
User-agent: | Thunderbird 1.5.0.9 (X11/20070103) |
Paul Smith wrote on 14/10/07 17:39:
On Sun, 2007-10-14 at 20:40 +0800, Zhongxing Xu wrote:In function library_search(), libpatterns and buf is malloced memory in line 1486 and 1553respectively.They are not freed. Is this true?Correct, they are not freed--but no, this is not a memory leak. These variables are declared static so the next time the function is invoked they still point to that same memory buffer. This is just a way to avoid allocating/freeing a local memory buffer over and over.
Do they get free'd up when make exits? Would be neater to cleanup any heap allocations, IMHO. Makes it less cloudly when tracking other memory-leaks as well.
Cheers, Jon -- linkme: http://www.linkedin.com/in/jongrant weblog: http://jguk.org/
[Prev in Thread] | Current Thread | [Next in Thread] |