From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120687 invoked by alias); 19 Oct 2016 17:24:51 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 120661 invoked by uid 89); 19 Oct 2016 17:24:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=H*r:112, H*UA:1.2.0, H*u:1.2.0 X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Oct 2016 17:24:49 +0000 Received: by simark.ca (Postfix, from userid 112) id 7A7191E7CE; Wed, 19 Oct 2016 13:24:47 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 187401E109; Wed, 19 Oct 2016 13:24:46 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 19 Oct 2016 17:24:00 -0000 From: Simon Marchi To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 02/31] cli/cli-script.c: Remove some dead NULL checks In-Reply-To: <1476839539-8374-3-git-send-email-palves@redhat.com> References: <1476839539-8374-1-git-send-email-palves@redhat.com> <1476839539-8374-3-git-send-email-palves@redhat.com> Message-ID: <4cc5cb88f049b2ded83eb58a30a93eb5@simark.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.0 X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00574.txt.bz2 On 2016-10-18 21:11, Pedro Alves wrote: > @@ -853,8 +845,6 @@ insert_args (char *line) > > /* Allocate space for the new line and fill it in. */ > new_line = (char *) xmalloc (len + 1); > - if (new_line == NULL) > - return NULL; > > /* Restore pointer to beginning of old line. */ > line = save_line; A few lines higher in insert_args, there is: error (_("Missing argument %d in user function."), i); return NULL; That return NULL is also dead code and could be confusing, leading someone to think insert_args can return NULL. I think you could remove it at the same time.