[2/8] Replace use of xfree with byte_vector
Commit Message
This replaces a use of xfree with a byte_vector.
---
gdb/tracectf.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
@@ -1358,10 +1358,9 @@ ctf_target::xfer_partial (enum target_object object,
{
const struct bt_definition *array
= bt_ctf_get_field (event, scope, "contents");
- gdb_byte *contents;
int k;
- contents = (gdb_byte *) xmalloc (mlen);
+ gdb::byte_vector contents (mlen);
for (k = 0; k < mlen; k++)
{
@@ -1377,8 +1376,6 @@ ctf_target::xfer_partial (enum target_object object,
memcpy (readbuf, &contents[offset - maddr], amt);
- xfree (contents);
-
/* Restore the position. */
bt_iter_set_pos (bt_ctf_get_iter (ctf_iter), pos);