Remove duplicated xmalloc in update_dprintf_command_list
authorGabriel Krisman Bertazi <gabriel@krisman.be>
Sun, 19 Apr 2015 22:34:08 +0000 (19:34 -0300)
committerGabriel Krisman Bertazi <gabriel@krisman.be>
Sun, 19 Apr 2015 23:07:33 +0000 (20:07 -0300)
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.

gdb/ChangeLog
gdb/breakpoint.c

index 4bca7d6fdd9b75e1b5bf3d42b885ab98a687a722..f878a1a3fb33a5a5affc201b1781961e3e9086e3 100644 (file)
@@ -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.
index 31869f1d263a8b76622a99748dc2a7557bd8d781..a3531a01cc16ae8332bf6c376351e043de4224bd 100644 (file)
@@ -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;