aboutsummaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-02-13 05:42:18 -0700
committerTom Tromey <tromey@adacore.com>2019-02-15 13:21:39 -0700
commitcc12f4a8f97791cf9729ff9341f7c0fbd9d6a79e (patch)
treebd571207b968a3430d9a4e4f0911c51b35dbb29d /gdb/source.c
parent5f486660101ab09d50fa3bb9a10555f12722f39f (diff)
downloadbinutils-cc12f4a8f97791cf9729ff9341f7c0fbd9d6a79e.zip
binutils-cc12f4a8f97791cf9729ff9341f7c0fbd9d6a79e.tar.gz
binutils-cc12f4a8f97791cf9729ff9341f7c0fbd9d6a79e.tar.bz2
Fix memory leak in create_ada_exception_catchpoint
Phillipe noticed that create_ada_exception_catchpoint was not freeing the "addr_string" memory: ==14141== 114 bytes in 4 blocks are definitely lost in loss record 1,054 of 3,424 ==14141== at 0x4C2BE6D: malloc (vg_replace_malloc.c:309) ==14141== by 0x405107: xmalloc (common-utils.c:44) ==14141== by 0x7563F9: xstrdup (xstrdup.c:34) ==14141== by 0x381B21: ada_exception_sal (ada-lang.c:13217) ==14141== by 0x381B21: create_ada_exception_catchpoint(gdbarch*, ada_exception_catchpoint_kind, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int, int) (ada-lang.c:13251) ==14141== by 0x3820A8: catch_ada_exception_command(char const*, int, cmd_list_element*) (ada-lang.c:13285) ==14141== by 0x3F4828: cmd_func(cmd_list_element*, char const*, int) (cli-decode.c:1892) This patch fixes the problem by changing ada_exception_sal to return a std::string via its out parameter. gdb/ChangeLog 2019-02-15 Philippe Waroquiers <philippe.waroquiers@skynet.be> Tom Tromey <tromey@adacore.com> * ada-lang.c (ada_exception_sal): Change addr_string to a std::string. (create_ada_exception_catchpoint): Update.
Diffstat (limited to 'gdb/source.c')
0 files changed, 0 insertions, 0 deletions