On 04/ 8/11 01:18 PM, Jakob Bornecrantz wrote:
> On Fri, Apr 8, 2011 at 10:12 PM, Jakob Bornecrantz <wallbra...@gmail.com> 
> wrote:
>> On Fri, Apr 8, 2011 at 10:04 PM, Alan Coopersmith
>> <alan.coopersm...@oracle.com> wrote:
>>> Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com>
>>
>> Obvious question to this is was the string returned from
>> GET_PROGRAM_NAME freed in the past?
> 
> Bah, read the code again while we only leak one string its still a
> leak and valgrind will complain (libraries that have these type of
> leaks is a pet peeve of mine). But making it not leak will be
> ridiculous, bah humbug. Other then that I see no problems with the
> patch, while you don't have my ACK/RB I'm not NACK:ing it either.

Will it?  It's not truly leaked since it's stored in a static for re-use.

Unfortunately, GET_PROGRAM_NAME() does different things on different OS'es,
and the current model doesn't free it on any.

I suppose we could also define FREE_PROGRAM_NAME() and define it to do
nothing on OS'es where it returns a pointer to a static string from libc,
but that's a bit overkill for the handful of bytes in the average case.
(If your execname is more than 1k, you're doing it wrong.)

-- 
        -Alan Coopersmith-        alan.coopersm...@oracle.com
         Oracle Solaris Platform Engineering: X Window System

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to