[PATCH] mesg.c: make tty variable use only dynamic memory

gotrunks at gmail.com gotrunks at gmail.com
Sat Mar 19 11:07:30 UTC 2011


On Fri, Mar 18, 2011 at 12:34 PM, Alexey Fomenko
<ext-alexey.fomenko at nokia.com> wrote:
> A small resource leak in init/mesg.c appears when xmalloc_ttyname()
> returns pointer to allocated memory, we need to free it afterwards,
> but it can contain also non-dynamic memory.
> This patch makes this variable use only dynamically allocated
> memory, so we can free it anyway.
>
> Alexey Fomenko (1):
>  make variable tty use only dynamic memory, so we can free it
>
>  init/mesg.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>

Excuse me for the dumb question but, isn't expected the system itself
to free up memory on exit?

Regards,
-
Pere


More information about the busybox mailing list