From: Tom Tromey Date: Wed, 22 Jun 2022 23:36:05 +0000 (-0600) Subject: Replace use of xfree with byte_vector X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ec714f6b595f4487e20d2ee38934397735e9f0d9;p=binutils-gdb.git Replace use of xfree with byte_vector This replaces a use of xfree with a byte_vector. Reviewed-by: Keith Seitz --- 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);