This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PATCH: readline/bind.c, resource leak
- From: Jim Blandy <jimb at codesourcery dot com>
- To: msnyder at sonic dot net
- Cc: gdb-patches at sourceware dot org, bug-readline at gnu dot org
- Date: Tue, 14 Aug 2007 16:54:04 -0700
- Subject: Re: PATCH: readline/bind.c, resource leak
- References: <21442.12.7.175.2.1185934454.squirrel@webmail.sonic.net>
Looks right to me.
msnyder@sonic.net writes:
> 2007-07-31 Michael Snyder <msnyder@access-company.com>
>
> * bind.c (rl_generic_bind): Resource leak.
>
> Index: bind.c
> ===================================================================
> RCS file: /cvs/src/src/readline/bind.c,v
> retrieving revision 1.8
> diff -p -r1.8 bind.c
> *** bind.c 5 May 2006 18:26:12 -0000 1.8
> --- bind.c 1 Aug 2007 02:05:21 -0000
> *************** rl_generic_bind (type, keyseq, data, map
> *** 370,376 ****
>
> ic = uc;
> if (ic < 0 || ic >= KEYMAP_SIZE)
> ! return -1;
>
> if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii)
> {
> --- 370,379 ----
>
> ic = uc;
> if (ic < 0 || ic >= KEYMAP_SIZE)
> ! {
> ! free (keys);
> ! return -1;
> ! }
>
> if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii)
> {