coverage.c: Fix leak of da_file_name
David Malcolm
dmalcolm@redhat.com
Thu Oct 10 00:26:00 GMT 2013
coverage_init allocates da_file_name using XNEWVEC, but it is never
freed. This shows up as a slow memory leak in my JIT code when
repeatedly invoking the compiler code within a single process.
This patch frees it in coverage_finish with XDELETEVEC (and NULLs it to
be sure).
Bootstrapped and regtested against trunk on x86_64-unknown-linux.
OK for trunk?
(Seen using valgrind; I've already committed this on my dmalcolm/jit
branch as:
http://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=963eb9c93e3e599ff577f9c3a19c6ccdcc9779c5
)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-leak-of-da_file_name.patch
Type: text/x-patch
Size: 599 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20131010/4ba3c2e5/attachment.bin>
More information about the Gcc-patches
mailing list