From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22042 invoked by alias); 15 Apr 2011 01:07:48 -0000 Received: (qmail 22032 invoked by uid 22791); 15 Apr 2011 01:07:47 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mailgw.tensilica.com (HELO mailgw.tensilica.com) (65.119.96.134) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 Apr 2011 01:07:43 +0000 Received: from localhost (unknown [127.0.0.1]) by mailgw.tensilica.com (Postfix) with ESMTP id 8D6911160C6F; Fri, 15 Apr 2011 01:07:42 +0000 (UTC) Received: from mailgw.tensilica.com ([127.0.0.1]) by localhost (mailgw.tensilica.com [127.0.0.1]) (amavisd-maia, port 10024) with ESMTP id 20381-09; Thu, 14 Apr 2011 18:07:42 -0700 (PDT) Received: from mail.tensilica.com (mail.tensilica.com [192.168.15.138]) by mailgw.tensilica.com (Postfix) with ESMTP id 13AFB1160C7A; Thu, 14 Apr 2011 18:07:42 -0700 (PDT) Received: from [192.168.11.68] (192.168.11.68) by mail.tensilica.com (192.168.15.138) with Microsoft SMTP Server id 8.2.254.0; Thu, 14 Apr 2011 18:07:38 -0700 Message-ID: <4DA79A59.5030802@tensilica.com> Date: Fri, 15 Apr 2011 01:07:00 -0000 From: Maxim Grigoriev User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.10 MIME-Version: 1.0 To: Tom Tromey CC: Pierre Muller , "gdb-patches@sourceware.org" Subject: Re: [RFA] xtensa-tdep.c ARI fixes References: <15837.6740910628$1302342165@news.gmane.org> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2011-04/txt/msg00214.txt.bz2 Thanks for noticing this. xfree () is necessary here. -- Maxim On 04/14/2011 01:31 PM, Tom Tromey wrote: >>>>>> "Pierre" == Pierre Muller writes: >>>>>> > Pierre> The only non-trivial change is in xtensa_register_type: > Pierre> this is mainly because I do not understand the old code: > Pierre> it was using both xmalloc and strdup, which should > Pierre> create a memory leak, no? > Pierre> But maybe I miss something? > > I agree. > > Pierre> - char *name = xmalloc (16); > Pierre> + char *name = xstrprintf ("int%d", size * 8); > > Looks better. > > Pierre> + = arch_integer_type (gdbarch, size * 8, 1, name); > > arch_integer_type calls arch_type, which calls xstrdup(name). > So I think you need to xfree name here. > > Tom >