diff mbox

[4/4] tui-winsource: Remove failed-allocation logic

Message ID 1478631454-9447-5-git-send-email-arnez@linux.vnet.ibm.com
State New
Headers show

Commit Message

Andreas Arnez Nov. 8, 2016, 6:56 p.m. UTC
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(-)

Comments

Pedro Alves Nov. 8, 2016, 7:31 p.m. UTC | #1
On 11/08/2016 06:56 PM, Andreas Arnez wrote:
> 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.

OK.

Thanks,
Pedro Alves
diff mbox

Patch

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);