Commit d14ae9b
committed
Zend: Fix string leak in zend_update_property_string{,l} on write failure
The four zend_update_{,static_}property_string{,l} helpers built a
zval with refcount 0 and called the write path, expecting the
consumer to absorb the only reference. Failure paths (readonly,
asymmetric visibility, type mismatch, magic __set throw) returned
without consuming the value, leaking the zend_string at refcount 0.
Build the zval normally and zval_ptr_dtor it after the write.1 parent bba2dc3 commit d14ae9b
1 file changed
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4984 | 4984 | | |
4985 | 4985 | | |
4986 | 4986 | | |
4987 | | - | |
4988 | 4987 | | |
| 4988 | + | |
4989 | 4989 | | |
4990 | 4990 | | |
4991 | 4991 | | |
| |||
4994 | 4994 | | |
4995 | 4995 | | |
4996 | 4996 | | |
4997 | | - | |
4998 | 4997 | | |
| 4998 | + | |
4999 | 4999 | | |
5000 | 5000 | | |
5001 | 5001 | | |
| |||
5085 | 5085 | | |
5086 | 5086 | | |
5087 | 5087 | | |
5088 | | - | |
5089 | | - | |
| 5088 | + | |
| 5089 | + | |
| 5090 | + | |
5090 | 5091 | | |
5091 | 5092 | | |
5092 | 5093 | | |
| |||
5095 | 5096 | | |
5096 | 5097 | | |
5097 | 5098 | | |
5098 | | - | |
5099 | | - | |
| 5099 | + | |
| 5100 | + | |
| 5101 | + | |
5100 | 5102 | | |
5101 | 5103 | | |
5102 | 5104 | | |
| |||
0 commit comments