]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/amd-dbgapi: remove one xfree
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 5 Jun 2025 20:30:25 +0000 (16:30 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Fri, 6 Jun 2025 19:22:02 +0000 (15:22 -0400)
Replace a manual xfree with unique_xmalloc_ptr.

Change-Id: Id4d2065e3294c4761fe3c852962360712b53d7a8
Approved-By: Tom Tromey <tom@tromey.com>
Approved-by: Lancelot Six <lancelot.six@amd.com> (amdgpu)
gdb/amd-dbgapi-target.c

index 8e067b66bd868e01c9e729189e67eaed6d6d6149..819b373da3210de656bf82dc20d0fd3b5e5738df 100644 (file)
@@ -1860,13 +1860,14 @@ amd_dbgapi_target::update_thread_list ()
       if (changed == AMD_DBGAPI_CHANGED_NO)
        continue;
 
+      gdb::unique_xmalloc_ptr<amd_dbgapi_wave_id_t> wave_list_holder
+       (wave_list);
+
       /* Create a set and free the wave list.  */
       std::set<ptid_t::tid_type> 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.  */