binutils-gdb/gdb/python
Simon Marchi e8e7d10c39 python: Fix memleak in do_start_initialization
While playing with valgrind, I noticed that with Python 3, the progname
variable in do_start_initialization is not being freed (concat returns a
malloc'ed string).  This patch uses unique_xmalloc_ptr to manage it.
With Python 2, we pass progname it directly to Py_SetProgramName, so it
should not be freed.  We therefore release it before passing it.

gdb/ChangeLog:

	* python/python.c (do_start_initialization): Change progname
	type to gdb::unique_xmalloc_ptr.  Release the pointer when using
	Python 2.
2017-11-26 19:32:47 -05:00
..
lib/gdb
py-all-events.def
py-arch.c
py-auto-load.c Constify add_info 2017-11-07 13:59:09 -07:00
py-block.c
py-bpevent.c
py-breakpoint.c
py-cmd.c Constify execute_command 2017-11-07 13:59:09 -07:00
py-continueevent.c
py-event-types.def
py-event.c
py-event.h
py-events.h
py-evtregistry.c
py-evts.c
py-exitedevent.c
py-finishbreakpoint.c
py-frame.c
py-framefilter.c
py-function.c
py-gdb-readline.c Fix build with GCC 8: strncpy ->strcpy 2017-11-22 12:22:11 +00:00
py-inferior.c
py-infevents.c
py-infthread.c
py-instruction.c
py-instruction.h
py-lazy-string.c
py-linetable.c
py-newobjfileevent.c
py-objfile.c
py-param.c Constify add_setshow_* 2017-11-07 13:59:09 -07:00
py-prettyprint.c
py-progspace.c
py-record-btrace.c
py-record-btrace.h
py-record-full.c
py-record-full.h
py-record.c
py-record.h
py-ref.h
py-signalevent.c
py-stopevent.c
py-stopevent.h
py-symbol.c
py-symtab.c
py-threadevent.c
py-type.c
py-unwind.c Python unwinder sniffer: PyExc_KeyboardInterrupt -> Quit 2017-11-16 18:44:44 +00:00
py-utils.c
py-value.c Target FP: Handle interfaces to scripting languages 2017-11-06 16:00:47 +01:00
py-varobj.c
py-xmethods.c
python-config.py
python-internal.h
python.c python: Fix memleak in do_start_initialization 2017-11-26 19:32:47 -05:00
python.h