tui-winsource: Remove failed-allocation logic
authorAndreas Arnez <arnez@linux.vnet.ibm.com>
Wed, 9 Nov 2016 12:02:13 +0000 (13:02 +0100)
committerAndreas Arnez <arnez@linux.vnet.ibm.com>
Wed, 9 Nov 2016 12:02:13 +0000 (13:02 +0100)
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/ChangeLog
gdb/tui/tui-winsource.c

index d6b8b4747ce1550b4d5808c4ac60c80223978106..2f0f3c2da44fcbb48e85a4edbe1aa1b1be664efa 100644 (file)
@@ -1,3 +1,8 @@
+2016-11-09  Andreas Arnez  <arnez@linux.vnet.ibm.com>
+
+       * tui/tui-winsource.c (tui_alloc_source_buffer): Remove
+       failed-xmalloc handling.
+
 2016-11-09  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
        * tui/tui-winsource.c (tui_alloc_source_buffer): Subtract
index 4a82ae4f4381b24a8e136d74510f197b313a6b2e..8bbce83a1a14c0892ed334d5f7f95b1360c2475c 100644 (file)
@@ -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);