This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Remove duplicated xmalloc in update_dprintf_command_list
- From: Gabriel Krisman Bertazi <krisman at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 19 Apr 2015 23:09:06 -0000
- Subject: [binutils-gdb] Remove duplicated xmalloc in update_dprintf_command_list
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e31d7699a0b116025b48f1ab5214eddd2e56ef9f
commit e31d7699a0b116025b48f1ab5214eddd2e56ef9f
Author: Gabriel Krisman Bertazi <gabriel@krisman.be>
Date: Sun Apr 19 19:34:08 2015 -0300
Remove duplicated xmalloc in update_dprintf_command_list
Code in update_dprintf_command_list performed a duplicated memory
allocation which caused an obvious memory leak. This removes the
duplication.
gdb/
2015-04-19 Gabriel Krisman Bertazi <gabriel@krisman.be>
* breakpoint.c (update_dprintf_command_list): Remove duplicated
xmalloc.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/breakpoint.c | 1 -
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4bca7d6..f878a1a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-19 Gabriel Krisman Bertazi <gabriel@krisman.be>
+
+ * breakpoint.c (update_dprintf_command_list): Remove duplicated
+ xmalloc.
+
2015-04-20 Thomas Schwinge <thomas@codesourcery.com>
* reply_mig_hack.awk: Robustify parsing.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 31869f1..a3531a0 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -9057,7 +9057,6 @@ update_dprintf_command_list (struct breakpoint *b)
struct command_line *printf_cmd_line
= xmalloc (sizeof (struct command_line));
- printf_cmd_line = xmalloc (sizeof (struct command_line));
printf_cmd_line->control_type = simple_control;
printf_cmd_line->body_count = 0;
printf_cmd_line->body_list = NULL;