Alex Lindsay <alexlindsay239@gmail.com> writes:
Formerly, in cp_canonicalize_string in cp-support.c, the return value of
cp_comp_to_string was never freed, creating a sizable memory leak detectable
with valgrind. This patch fixes the leak. However, a longer term solution
would be to change the return type of cp_comp_to_string to
gdb::unique_xmalloc_ptr<char>.
Hi Alex,
Thanks a lot for the investigation and the patch. I revise it a little
to use gdb::unique_xmalloc_ptr<char>, and fix another leak somewhere else.
Patch below is pushed in.