Change python_run_simple_file to use gdbpy_ref
authorTom Tromey <tom@tromey.com>
Sat, 12 Nov 2016 19:08:17 +0000 (12:08 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 11 Jan 2017 02:13:59 +0000 (19:13 -0700)
commit9de10f6d53dffbec12cec9843662d5764526983d
treef574cb2515db4b60057e0a731842edac2f1e9c32
parent2bd5759dcb71adfb26b1c7cf20b3b032af29b845
Change python_run_simple_file to use gdbpy_ref

This changes python_run_simple_file to use gdbpy_ref and
unique_xmalloc_ptr.  Thi fixes a latent bug in this function, where
the error path previously ran the cleanups and then referred to one of
the objects just freed.

2017-01-10  Tom Tromey  <tom@tromey.com>

* python/python.c (python_run_simple_file): Use
unique_xmalloc_ptr, gdbpy_ref.
gdb/ChangeLog
gdb/python/python.c