diff options
author | Tom Tromey <tom@tromey.com> | 2022-06-22 17:36:05 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-07-10 13:02:11 -0600 |
commit | ec714f6b595f4487e20d2ee38934397735e9f0d9 (patch) | |
tree | 12f3382e02b69d2f5d406ebaac7321408ae370af /gdb | |
parent | fb4e5d7dda1bd2dc37fa977d34225fd02b419e11 (diff) | |
download | gdb-ec714f6b595f4487e20d2ee38934397735e9f0d9.zip gdb-ec714f6b595f4487e20d2ee38934397735e9f0d9.tar.gz gdb-ec714f6b595f4487e20d2ee38934397735e9f0d9.tar.bz2 |
Replace use of xfree with byte_vector
This replaces a use of xfree with a byte_vector.
Reviewed-by: Keith Seitz <keiths@redhat.com>
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/tracectf.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/gdb/tracectf.c b/gdb/tracectf.c index 1646171..8f6ea25 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); |