From: Simon Marchi Date: Thu, 5 Jun 2025 20:30:25 +0000 (-0400) Subject: gdb/amd-dbgapi: remove one xfree X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8d46965efced0843b1ed94fd0517055e737f263e;p=thirdparty%2Fbinutils-gdb.git gdb/amd-dbgapi: remove one xfree Replace a manual xfree with unique_xmalloc_ptr. Change-Id: Id4d2065e3294c4761fe3c852962360712b53d7a8 Approved-By: Tom Tromey Approved-by: Lancelot Six (amdgpu) --- diff --git a/gdb/amd-dbgapi-target.c b/gdb/amd-dbgapi-target.c index 8e067b66bd8..819b373da32 100644 --- a/gdb/amd-dbgapi-target.c +++ b/gdb/amd-dbgapi-target.c @@ -1860,13 +1860,14 @@ amd_dbgapi_target::update_thread_list () if (changed == AMD_DBGAPI_CHANGED_NO) continue; + gdb::unique_xmalloc_ptr wave_list_holder + (wave_list); + /* Create a set and free the wave list. */ std::set threads; for (size_t i = 0; i < count; ++i) threads.emplace (wave_list[i].handle); - xfree (wave_list); - /* Prune the wave_ids that already have a thread_info. Any thread_info which does not have a corresponding wave_id represents a wave which is gone at this point and should be deleted. */