From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12368 invoked by alias); 19 Nov 2002 16:26:20 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 12326 invoked from network); 19 Nov 2002 16:26:17 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 19 Nov 2002 16:26:17 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id BBF993E39; Tue, 19 Nov 2002 11:26:12 -0500 (EST) Message-ID: <3DDA6624.5000500@redhat.com> Date: Tue, 19 Nov 2002 08:26:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alan Modra Cc: Klee Dienes , binutils@sources.redhat.com, gdb@sources.redhat.com Subject: Re: [RFA] Replace strdup with xstrdup in tic30-dis.c References: <555D137A-FB43-11D6-84AF-00039396EEB8@apple.com> <20021119071305.GM997@bubble.sa.bigpond.net.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-11/txt/msg00227.txt.bz2 > On Mon, Nov 18, 2002 at 05:16:06PM -0500, Klee Dienes wrote: > >> * tic30-dis.c (print_par_insn): Use xstrdup instead of strdup. Alan, to clarify something here. I know BFD intentionally doesn't use the x*() functions. Instead it tries to clean up and return an error indication when there is a malloc() failure. What of the disassembler though? GDB, which is depending on the disassembler, needs to be able to recover from low memory (aka malloc() failure) conditions. Is using xstrdup() in the disassembler going to lead to memory leaks in the case where xmalloc() fails? Andrew