From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21157 invoked by alias); 27 Feb 2009 18:55:41 -0000 Received: (qmail 21147 invoked by uid 22791); 27 Feb 2009 18:55:40 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 27 Feb 2009 18:55:32 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n1RItOGa029201 for ; Fri, 27 Feb 2009 13:55:24 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n1RItOqe020874; Fri, 27 Feb 2009 13:55:24 -0500 Received: from opsy.redhat.com (vpn-13-28.rdu.redhat.com [10.11.13.28]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n1RItNA5018651; Fri, 27 Feb 2009 13:55:24 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id D2AA73780F7; Fri, 27 Feb 2009 11:55:21 -0700 (MST) To: Phil Muldoon Cc: gdb-patches@sourceware.org Subject: Re: [patch] valprint.c (read_string): Rework clean-up logic. References: <49A82F5C.9000801@redhat.com> From: Tom Tromey Reply-To: tromey@redhat.com Date: Fri, 27 Feb 2009 19:56:00 -0000 In-Reply-To: <49A82F5C.9000801@redhat.com> (Phil Muldoon's message of "Fri\, 27 Feb 2009 18\:22\:20 +0000") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2009-02/txt/msg00495.txt.bz2 >>>>> "Phil" == Phil Muldoon writes: Phil> 2009-02-27 Phil Muldoon Phil> * valprint.c (xfree_gdb_byte): New function. Phil> (read_string): Rework clean-up logic. Use xfree_gdb_byte for Phil> clean-up. This is almost ok... Phil> +/* Local clean-up for a gdb_byte buffer pointed to via double Phil> + indirection. This function is used in read_string. */ Phil> +static void Phil> +xfree_gdb_byte (void *buffer) I forgot that there is already a function for this -- free_current_contents. So, this new function is not needed... Phil> + old_chain = make_cleanup (xfree_gdb_byte, buffer); ... and you can just s/xfree_gdb_byte/free_current_contents/ here. It is ok with that change. Thanks. Tom