Commit c54f9ca
regcomp: ensure the RExC_state freed earlier rather than later
388bf71 (ignoring #23022 for now) ensured that the RExC_state
and its controlled pointers were freed once and only once,
regardless of whether re_op_compile() returned normally or threw
an exception.
Unfortunately that free could happen very later, surviving well beyond
when the regexp was compiled.
Add an ENTER/LEAVE pair to ensure the cleanup is done immediately
on a normal return.1 parent d09b612 commit c54f9ca
1 file changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1481 | 1481 | | |
1482 | 1482 | | |
1483 | 1483 | | |
| 1484 | + | |
1484 | 1485 | | |
1485 | 1486 | | |
1486 | 1487 | | |
| |||
1578 | 1579 | | |
1579 | 1580 | | |
1580 | 1581 | | |
| 1582 | + | |
| 1583 | + | |
1581 | 1584 | | |
1582 | 1585 | | |
1583 | 1586 | | |
| |||
1593 | 1596 | | |
1594 | 1597 | | |
1595 | 1598 | | |
1596 | | - | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
1597 | 1602 | | |
1598 | 1603 | | |
1599 | 1604 | | |
| |||
1643 | 1648 | | |
1644 | 1649 | | |
1645 | 1650 | | |
| 1651 | + | |
1646 | 1652 | | |
1647 | 1653 | | |
1648 | 1654 | | |
| |||
2477 | 2483 | | |
2478 | 2484 | | |
2479 | 2485 | | |
| 2486 | + | |
2480 | 2487 | | |
2481 | 2488 | | |
2482 | 2489 | | |
| |||
0 commit comments