This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] target.c/read_whatever_is_readable: fix memory leak


Joel Brobecker wrote:
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.


Thanks - committed.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]