From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19715 invoked by alias); 8 Mar 2011 18:59:22 -0000 Received: (qmail 19706 invoked by uid 22791); 8 Mar 2011 18:59:22 -0000 X-SWARE-Spam-Status: No, hits=-5.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Mar 2011 18:59:17 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 7EF8C42003; Tue, 8 Mar 2011 10:59:16 -0800 (PST) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost3.vmware.com (Postfix) with ESMTP id 4B93ECDA83; Tue, 8 Mar 2011 10:59:16 -0800 (PST) Message-ID: <4D767C83.9040908@vmware.com> Date: Tue, 08 Mar 2011 19:39:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.24 (X11/20101201) MIME-Version: 1.0 To: Joel Brobecker CC: "gdb-patches@sourceware.org" Subject: Re: [RFA] target.c/read_whatever_is_readable: fix memory leak References: <4D6ADE45.5040705@vmware.com> <20110308045814.GK30306@adacore.com> In-Reply-To: <20110308045814.GK30306@adacore.com> 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-03/txt/msg00562.txt.bz2 Joel Brobecker wrote: >> 2011-02-27 Michael Snyder >> >> * target.c (read_whatever_is_readable): Fix memory leak. > > Looks correct to me. > >> { >> - gdb_byte *buf = xmalloc (end-begin); >> + gdb_byte *buf = xmalloc (end - begin); > > I applied this change myself (as well as a couple of other reformatting > changes), mostly because I have a fairly strong preference over > separating this type of change (reformatting - no code change) from > code changes. It simplifies our task if/when a revert is needed. > > With git, there is a neat way to commit those changes separately > from your other changes: It's "git add -p" - it then asks you > hunk by hunk whether to put the change in the index or not (and > you and further divide hunks if necessary). Really useful in this > sort of situation. > Thanks - committed.