Fix memory leak of the demangled symbol name
authorChristian Biesinger <cbiesinger@google.com>
Wed, 8 Jan 2020 01:10:40 +0000 (19:10 -0600)
committerChristian Biesinger <cbiesinger@google.com>
Thu, 9 Jan 2020 19:13:04 +0000 (13:13 -0600)
commit57d750026550cf3a589e3f28a0cdc303ba5ed039
tree0f736a1162600cd6a325bde3cf012a7e0d865215
parentffebb0bbde7deae978ab3e4d3d3d90acf52b7d69
Fix memory leak of the demangled symbol name

compute_and_set_names would only free the name if we did not find the name
in the hashtable, but it needs to always free it.  Solve this by moving the
smart pointer outside the if.

Thanks to PhilippeW for finding this.

gdb/ChangeLog:

2020-01-09  Christian Biesinger  <cbiesinger@google.com>

* symtab.c (general_symbol_info::compute_and_set_names): Move the
unique_xmalloc_ptr outside the if to always free the demangled name.

Change-Id: Id7c6b8408432183700ccb5ff634818d6c5a3ac95
gdb/ChangeLog
gdb/symtab.c
This page took 0.024272 seconds and 4 git commands to generate.