Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Michael Snyder <msnyder@vmware.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [RFA] target.c/read_whatever_is_readable: fix memory leak
Date: Tue, 08 Mar 2011 05:13:00 -0000	[thread overview]
Message-ID: <20110308045814.GK30306@adacore.com> (raw)
In-Reply-To: <4D6ADE45.5040705@vmware.com>

> 2011-02-27  Michael Snyder  <msnyder@vmware.com>
> 
> 	* 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.

-- 
Joel


  parent reply	other threads:[~2011-03-08  4:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-27 23:50 Michael Snyder
2011-03-07 20:16 ` Michael Snyder
2011-03-08  5:13 ` Joel Brobecker [this message]
2011-03-08 19:39   ` Michael Snyder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110308045814.GK30306@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox