This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfa] mem leak in catch_syscall_completer
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Sun, 27 Feb 2011 14:30:12 -0800
- Subject: [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. */