[Lldb-commits] [lldb] r279627 - Fix mismatched new/free in Process:RunPrivateStateThread

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 24 07:03:11 PDT 2016


Author: labath
Date: Wed Aug 24 09:03:10 2016
New Revision: 279627

URL: http://llvm.org/viewvc/llvm-project?rev=279627&view=rev
Log:
Fix mismatched new/free in Process:RunPrivateStateThread

NFC

Modified:
    lldb/trunk/source/Target/Process.cpp

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=279627&r1=279626&r2=279627&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Wed Aug 24 09:03:10 2016
@@ -4297,9 +4297,8 @@ Process::HaltPrivate()
 thread_result_t
 Process::PrivateStateThread (void *arg)
 {
-    PrivateStateThreadArgs real_args = *static_cast<PrivateStateThreadArgs *> (arg);
-    free (arg);
-    thread_result_t result = real_args.process->RunPrivateStateThread(real_args.is_secondary_thread);
+    std::unique_ptr<PrivateStateThreadArgs> args_up(static_cast<PrivateStateThreadArgs *>(arg));
+    thread_result_t result = args_up->process->RunPrivateStateThread(args_up->is_secondary_thread);
     return result;
 }
 




More information about the lldb-commits mailing list