Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* PATCH: readline/histexpand.c, resource leak
@ 2007-08-01  2:14 msnyder
  2007-08-10 21:32 ` msnyder
  2007-08-15  0:01 ` Jim Blandy
  0 siblings, 2 replies; 11+ messages in thread
From: msnyder @ 2007-08-01  2:14 UTC (permalink / raw)
  To: gdb-patches, bug-readline

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 130.txt --]
[-- Type: text/plain, Size: 983 bytes --]

2007-07-31  Michael Snyder  <msnyder@access-company.com>

	* histexpand.c (history_find_word): Resource leak.

Index: histexpand.c
===================================================================
RCS file: /cvs/src/src/readline/histexpand.c,v
retrieving revision 1.6
diff -p -r1.6 histexpand.c
*** histexpand.c	5 May 2006 18:26:12 -0000	1.6
--- histexpand.c	1 Aug 2007 02:08:51 -0000
*************** history_find_word (line, ind)
*** 1581,1588 ****
    int i, wind;
  
    words = history_tokenize_internal (line, ind, &wind);
!   if (wind == -1 || words == 0)
      return ((char *)NULL);
    s = words[wind];
    for (i = 0; i < wind; i++)
      free (words[i]);
--- 1581,1594 ----
    int i, wind;
  
    words = history_tokenize_internal (line, ind, &wind);
!   if (words == NULL)
      return ((char *)NULL);
+   if (wind == -1)
+     {
+       free (words);
+       return ((char *)NULL);
+     }
+ 
    s = words[wind];
    for (i = 0; i < wind; i++)
      free (words[i]);

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-08-22  2:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-01  2:14 PATCH: readline/histexpand.c, resource leak msnyder
2007-08-10 21:32 ` msnyder
2007-08-15  0:01 ` Jim Blandy
2007-08-15  0:38   ` msnyder
2007-08-15  1:20     ` Daniel Jacobowitz
2007-08-15  1:40       ` msnyder
2007-08-15 21:43     ` Jim Blandy
2007-08-18 20:12   ` [Bug-readline] " Chet Ramey
2007-08-18 20:15     ` msnyder
2007-08-20 17:03     ` Jim Blandy
2007-08-22  2:02       ` Chet Ramey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox