[Lldb-commits] [lldb] r165597 - /lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp

Jason Molenda jmolenda at apple.com
Tue Oct 9 20:47:24 PDT 2012


Author: jmolenda
Date: Tue Oct  9 22:47:23 2012
New Revision: 165597

URL: http://llvm.org/viewvc/llvm-project?rev=165597&view=rev
Log:
Free the opcode_data malloc'ed memory instead of leaking it - thanks for catching that, Chris.

Modified:
    lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp

Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp?rev=165597&r1=165596&r2=165597&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp (original)
+++ lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp Tue Oct  9 22:47:23 2012
@@ -485,6 +485,7 @@
     Target *target = m_exe_ctx.GetTargetPtr();
     if (target->ReadMemory (addr, prefer_file_cache, opcode_data, max_op_byte_size, error) == -1)
     {
+        free (opcode_data);
         return false;
     }
    
@@ -498,7 +499,7 @@
                                                       sizeof(out_string));
 
     length = inst_size;
-
+    free (opcode_data);
     return true;
 }
 





More information about the lldb-commits mailing list