Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andreas Arnez <arnez@linux.vnet.ibm.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 4/4] tui-winsource: Remove failed-allocation logic
Date: Tue, 08 Nov 2016 19:00:00 -0000	[thread overview]
Message-ID: <1478631454-9447-5-git-send-email-arnez@linux.vnet.ibm.com> (raw)
In-Reply-To: <1478631454-9447-1-git-send-email-arnez@linux.vnet.ibm.com>

This removes dead code in tui_alloc_source_buffer for handling a NULL
return value from xmalloc.

gdb/ChangeLog:

	* tui/tui-winsource.c (tui_alloc_source_buffer): Remove
	failed-xmalloc handling.
---
 gdb/tui/tui-winsource.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 4a82ae4..8bbce83 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -618,23 +618,8 @@ tui_alloc_source_buffer (struct tui_win_info *win_info)
     {
       src_line_buf = (char *) 
 	xmalloc ((max_lines * line_width) * sizeof (char));
-      if (src_line_buf == (char *) NULL)
-	{
-	  fputs_unfiltered ("Unable to Allocate Memory for "
-			    "Source or Disassembly Display.\n",
-			    gdb_stderr);
-	  return TUI_FAILURE;
-	}
       /* Allocate the content list.  */
       win_info->generic.content = tui_alloc_content (max_lines, SRC_WIN);
-      if (win_info->generic.content == NULL)
-	{
-	  xfree (src_line_buf);
-	  fputs_unfiltered ("Unable to Allocate Memory for "
-			    "Source or Disassembly Display.\n",
-			    gdb_stderr);
-	  return TUI_FAILURE;
-	}
       for (i = 0; i < max_lines; i++)
 	win_info->generic.content[i]->which_element.source.line
 	  = src_line_buf + (line_width * i);
-- 
2.5.0


  parent reply	other threads:[~2016-11-08 19:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-08 18:57 [PATCH 0/4] Some TUI fixes Andreas Arnez
2016-11-08 18:58 ` [PATCH 1/4] tui-disasm: Fix window content buffer overrun Andreas Arnez
2016-11-08 19:29   ` Pedro Alves
2016-11-09 12:07     ` Andreas Arnez
2016-11-08 18:59 ` [PATCH 3/4] tui-winsource: Allocate for actual lines only Andreas Arnez
2016-11-08 19:31   ` Pedro Alves
2016-11-08 18:59 ` [PATCH 2/4] tui-disasm: Fix line buffer size calculation Andreas Arnez
2016-11-08 19:30   ` Pedro Alves
2016-11-08 19:00 ` Andreas Arnez [this message]
2016-11-08 19:31   ` [PATCH 4/4] tui-winsource: Remove failed-allocation logic Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1478631454-9447-5-git-send-email-arnez@linux.vnet.ibm.com \
    --to=arnez@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox