[all-commits] [llvm/llvm-project] 4a38d3: [lldb] Fix double free in python bindings error ha...

Jorge Gorbe Moya via All-commits all-commits at lists.llvm.org
Mon Mar 27 16:07:56 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4a38d33268959309dd97d9ef423327607bda4104
  Author: Jorge Gorbe Moya <jgorbe at google.com>
  Date:   2023-03-27 (Mon, 27 Mar 2023)

  Changed paths:
    M lldb/bindings/python/python-typemaps.swig

  Log Message:
  [lldb] Fix double free in python bindings error handling.

If we have a `%typemap(freearg)` that frees the argument, we shouldn't
free it manually on an error path before calling `SWIG_fail`.
`SWIG_fail` will already free the memory in this case, and doing it
manually results in a double free.

Differential Revision: https://reviews.llvm.org/D147007

More information about the All-commits mailing list