2011-02-27 Michael Snyder <msnyder@vmware.com>

* target.c (read_whatever_is_readable): Fix memory leak.
This commit is contained in:
Michael Snyder
2011-03-08 18:58:54 +00:00
parent d3f323f3d2
commit 13b3fd9b17
2 changed files with 7 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
2011-03-08 Michael Snyder <msnyder@vmware.com>
* target.c (read_whatever_is_readable): Fix memory leak.
* i386-tdep.c (i386_process_record): Document fall through.
2011-03-08 Jan Kratochvil <jan.kratochvil@redhat.com>

View File

@@ -1968,7 +1968,10 @@ read_whatever_is_readable (struct target_ops *ops,
/* If we previously failed to read 1 byte, nothing can be done here. */
if (end - begin <= 1)
return;
{
xfree (buf);
return;
}
/* Check that either first or the last byte is readable, and give up
if not. This heuristic is meant to permit reading accessible memory
@@ -1987,6 +1990,7 @@ read_whatever_is_readable (struct target_ops *ops,
}
else
{
xfree (buf);
return;
}