develooper Front page | perl.perl5.porters | Postings from June 2016

[perl #128313] Memory leak in perl 5.24.0 when use re qw[strict] isused

Thread Previous | Thread Next
From:
Dan Collins via RT
Date:
June 8, 2016 18:38
Subject:
[perl #128313] Memory leak in perl 5.24.0 when use re qw[strict] isused
Message ID:
rt-4.0.18-16809-1465411093-544.128313-15-0@perl.org
Yves' patch changes warn_text from leaking to mortal if posix_warnings is set and the function ends early, no change in any other case. In other words, it /never/ called SvREFCNT_dec_NN(warn_text), either before or now.

Alternately, since posix_warnings isn't set if the function returns early, we can SvREFCNT_dec(warn_text) if we return early. My limited testing suggests that the memory advantage is minimal, but it's probably "more right" to free it immediately before returning. Is the attached patch what you were thinking? It still fixes this bug, and all tests still pass.

(Patch is against blead /before/ Yves' patch was applied, if you'd prefer a patch against blead, that can be arranged.

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=128313

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About