Skip to content

Commit ba2623c

Browse files
tonycozmauke
authored andcommitted
signatures: don't leak an OP_NULL for a '$ =' sigscalarelem
Fixes #23187
1 parent b5a660b commit ba2623c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

op.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16551,6 +16551,9 @@ Perl_subsignature_append_positional(pTHX_ OP *varop, OPCODE defmode, OP *defexpr
1655116551

1655216552
if(defexpr->op_type == OP_NULL && !(defexpr->op_flags & OPf_KIDS))
1655316553
{
16554+
/* caller passed in newOP(OP_NULL, 0), so we should not leak it */
16555+
op_free(defexpr);
16556+
1655416557
/* handle '$=' special case */
1655516558
if(varop)
1655616559
yyerror("Optional parameter lacks default expression");

0 commit comments

Comments
 (0)