aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-darwin-nat.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2017-11-26 19:32:47 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2017-11-26 19:32:47 -0500
commite8e7d10c39955e7ff99ff42f6f16d6befe2fa12e (patch)
treeeaf62d9bf2d3b4d1171eaf7dafea96ac454c0e72 /gdb/i386-darwin-nat.c
parent7db85adb3b988560d9d4706d826e193e83ae7cd9 (diff)
downloadgdb-e8e7d10c39955e7ff99ff42f6f16d6befe2fa12e.zip
gdb-e8e7d10c39955e7ff99ff42f6f16d6befe2fa12e.tar.gz
gdb-e8e7d10c39955e7ff99ff42f6f16d6befe2fa12e.tar.bz2
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.
Diffstat (limited to 'gdb/i386-darwin-nat.c')
0 files changed, 0 insertions, 0 deletions