This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: readline/bind.c, resource leak


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)
>   	{


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]