From patchwork Tue Nov 8 18:56:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 17299 Received: (qmail 11769 invoked by alias); 8 Nov 2016 19:00:30 -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 11646 invoked by uid 89); 8 Nov 2016 19:00:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RCVD_IN_SEMBACKSCATTER autolearn=no version=3.3.2 spammy=xmalloc, Display, Allocate X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 08 Nov 2016 19:00:22 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uA8IwXOG077717 for ; Tue, 8 Nov 2016 14:00:21 -0500 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 26khdrmthx-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 08 Nov 2016 14:00:20 -0500 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Nov 2016 19:00:18 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 8 Nov 2016 19:00:16 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 2F86317D805D for ; Tue, 8 Nov 2016 19:02:37 +0000 (GMT) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id uA8J0Ght22544496 for ; Tue, 8 Nov 2016 19:00:16 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id uA8I0H16021129 for ; Tue, 8 Nov 2016 11:00:17 -0700 Received: from oc1027705133.ibm.com (dyn-9-152-212-182.boeblingen.de.ibm.com [9.152.212.182]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id uA8HvanB019676 for ; Tue, 8 Nov 2016 11:00:17 -0700 From: Andreas Arnez To: gdb-patches@sourceware.org Subject: [PATCH 4/4] tui-winsource: Remove failed-allocation logic Date: Tue, 8 Nov 2016 19:56:54 +0100 In-Reply-To: <1478631454-9447-1-git-send-email-arnez@linux.vnet.ibm.com> References: <1478631454-9447-1-git-send-email-arnez@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16110819-0040-0000-0000-0000025A37DD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16110819-0041-0000-0000-0000227FE8E8 Message-Id: <1478631454-9447-5-git-send-email-arnez@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-11-08_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611080344 X-IsSubscribed: yes 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);