From ec714f6b595f4487e20d2ee38934397735e9f0d9 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 22 Jun 2022 17:36:05 -0600 Subject: [PATCH] Replace use of xfree with byte_vector This replaces a use of xfree with a byte_vector. Reviewed-by: Keith Seitz --- gdb/tracectf.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gdb/tracectf.c b/gdb/tracectf.c index 16461711da1..8f6ea250f61 100644 --- a/gdb/tracectf.c +++ b/gdb/tracectf.c @@ -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); -- 2.30.2