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]

[rfa] mem leak in catch_syscall_completer


I'll need review for this one.

2011-02-27  Michael Snyder  <msnyder@vmware.com>

	* breakpoint.c (catch_syscall_completer): Free malloced list.

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.542
diff -u -p -r1.542 breakpoint.c
--- breakpoint.c	27 Feb 2011 01:54:30 -0000	1.542
+++ breakpoint.c	27 Feb 2011 22:28:38 -0000
@@ -11345,8 +11345,11 @@ catch_syscall_completer (struct cmd_list
                          char *text, char *word)
 {
   const char **list = get_syscall_names ();
+  char **retlist
+    = (list == NULL) ? NULL : complete_on_enum (list, text, word);
 
-  return (list == NULL) ? NULL : complete_on_enum (list, text, word);
+  xfree (list);
+  return retlist;
 }
 
 /* Tracepoint-specific operations.  */

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