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: Sat, 21 May 2016 00:10:14 +0000 (UTC)

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.

Thanks,

Mike


reply via email to

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