Make cp_comp_to_string return a gdb::unique_xmalloc_ptr<char>
authorPedro Alves <palves@redhat.com>
Wed, 9 Aug 2017 14:04:32 +0000 (15:04 +0100)
committerPedro Alves <palves@redhat.com>
Wed, 9 Aug 2017 14:04:32 +0000 (15:04 +0100)
commit29592bde87d250ea56e8431053918899d3d0c16b
tree6dc7c4b6f29dcf555f17d7ad1f931e44331e7334
parentb33404388e5bbd8a1fddfde73cd4593ae2b557e8
Make cp_comp_to_string return a gdb::unique_xmalloc_ptr<char>

To help avoid issues like the one fixed by e88e8651cf34 ("Fix memory
leak in cp-support.c").

gdb/ChangeLog:
2017-08-09  Pedro Alves  <palves@redhat.com>

* cp-name-parser.y (cp_comp_to_string): Return a
gdb::unique_xmalloc_ptr<char>.
* cp-support.c (replace_typedefs_qualified_name)
(replace_typedefs): Adjust to use gdb::unique_xmalloc_ptr<char>.
(cp_canonicalize_string_full): Use op= instead of explicit
convertion.
(cp_class_name_from_physname, method_name_from_physname)
(cp_func_name, cp_remove_params): Adjust to use
gdb::unique_xmalloc_ptr<char>.
* cp-support.h (cp_comp_to_string): Return a
gdb::unique_xmalloc_ptr<char>.
* python/py-type.c (typy_lookup_type): Adjust to use
gdb::unique_xmalloc_ptr<char>.
gdb/ChangeLog
gdb/cp-name-parser.y
gdb/cp-support.c
gdb/cp-support.h
gdb/python/py-type.c