Commit 9f56efe
committed
Free unbound arguments when partial application construction throws
The ZEND_CALLABLE_CONVERT_PARTIAL handler relies on zp_bind() to move
each pre-bound argument into the partial and never frees positional
arguments itself. When construction throws before an argument is moved,
a NULL op_array from zp_get_op_array() or a bound-argument type error,
the unmoved arguments were owned by nobody and leaked. Free the
arguments that were not moved at each throwing path.1 parent dec19ed commit 9f56efe
2 files changed
Lines changed: 43 additions & 0 deletions
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1069 | 1069 | | |
1070 | 1070 | | |
1071 | 1071 | | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
1072 | 1079 | | |
1073 | 1080 | | |
1074 | 1081 | | |
| |||
1102 | 1109 | | |
1103 | 1110 | | |
1104 | 1111 | | |
| 1112 | + | |
1105 | 1113 | | |
1106 | 1114 | | |
1107 | 1115 | | |
| |||
1131 | 1139 | | |
1132 | 1140 | | |
1133 | 1141 | | |
| 1142 | + | |
1134 | 1143 | | |
1135 | 1144 | | |
1136 | 1145 | | |
| |||
0 commit comments