This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix memory leak in cp-support.c (cp_canonicalize_string)


Thanks Yao!

On 08/09/2017 06:40 AM, Yao Qi wrote:
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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]