bug-guile-ncurses
[Top][All Lists]
Advanced

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

Re: [Bug-guile-ncurses] Memory leak in new-item


From: Mike Gran
Subject: Re: [Bug-guile-ncurses] Memory leak in new-item
Date: Thu, 26 May 2016 04:28:40 +0000 (UTC)



> On Friday, May 20, 2016 5:10 PM, Mike Gran <address@hidden> wrote:
> > Hi John-
> 
>>  On Friday, May 20, 2016 5:34 AM, John Darrington 
> <address@hidden> wrote:
>>  > ncurses/menu_type.c:68 (gucu_new_item) Has the lines:
>> 
>>    char *c_name = scm_to_locale_string (name);
>>    char *c_description = scm_to_locale_string (description);
>> 
>>  But scm_to_locale_string allocates the memory for its return
>>  value on the heap, and c_name and c_description are never freed.
>> 
>>  Hence any call to new-item will leak memory.
>> 
> 
> 
> You're right.  They should be freed when the item is freed.

In the last few commits on master, I think I have this
error patched.  It was wrapped up into the work on the
implementation of refcounting for menu items that began at
the following commit, and was patched up the following few commits.

http://git.savannah.gnu.org/cgit/guile-ncurses.git/commit/?id=c3f20ee766c487f8d1d1c47152326e08b56cafb4


Thanks,

Mike Gran


reply via email to

[Prev in Thread] Current Thread [Next in Thread]