This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix leak in Perl_coresub_op()
authorDavid Mitchell <davem@iabyn.com>
Fri, 12 Apr 2019 13:06:21 +0000 (14:06 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 12 Apr 2019 14:58:04 +0000 (15:58 +0100)
commitdf10057779d7151c097d31e58b589c7b1e968d1f
treecfc2aab4df4525e347cc926d59ce0f5ef79a6fbb
parentad9115fb3ef3c0d588afd07c1b794e99cef3e1ed
fix leak in Perl_coresub_op()

This sub initially creates a new OP_COREARGS op to be made use of in the
various cases of a following switch statement. But in the specific case
of OP_SELECT, the op isn't actually used, and leaks. So don't allocate
it in this case.

The leak could be reproduced with the one-liner

    defined &{"CORE::select"};

and was causing t/op/coresubs.t to fail under Address Sanitiser.
op.c