Re: [gnome-db] [PATCH] Another memory leak



Andrea Zagli wrote:
> Il giorno lun, 31/03/2008 alle 07.57 +0200, Vivien Malerba ha scritto:
>> [...]
> 
> should not be instead a simple
> 
>>>  +       g_free (filename);
> 
> at the end?
> 
> if not, sorry for my inexperience ;-)

That would also work.  However, rather than duplicate the string and
immediately free filename, why not just keep and use filename.  It saves
the cost of the malloc, copy and free.

Phil



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]