From patchwork Sun Apr 19 23:11:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Krisman Bertazi X-Patchwork-Id: 6325 Received: (qmail 54524 invoked by alias); 19 Apr 2015 23:12:02 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 54508 invoked by uid 89); 19 Apr 2015 23:12:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-HELO: layla.krisman.be Received: from layla.krisman.be (HELO layla.krisman.be) (176.31.208.35) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 19 Apr 2015 23:11:59 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (envelope-from ) id 1YjyBr-0007d6-A2; Mon, 20 Apr 2015 00:59:51 +0200 From: Gabriel Krisman Bertazi To: gdb-patches@sourceware.org Cc: Gabriel Krisman Bertazi Subject: [OB PATCH] Remove duplicated xmalloc in update_dprintf_command_list Date: Sun, 19 Apr 2015 20:11:46 -0300 Message-Id: <1429485106-10583-1-git-send-email-gabriel@krisman.be> X-IsSubscribed: yes Hello, Just pushed this under the obvious rule. 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 * breakpoint.c (update_dprintf_command_list): Remove duplicated xmalloc. --- 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 + + * breakpoint.c (update_dprintf_command_list): Remove duplicated + xmalloc. + 2015-04-20 Thomas Schwinge * 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;