Commit 0e87ea3
committed
ext/zip: memory leak when zip cancel callback bails out.
Fix #22176
A cancel callback that throws during the implicit zip_close() in the
shutdown destructor triggers a zend_bailout that longjmps through
libzip, skipping its free(filelist). Wrap the call in zend_try/zend_catch
and cancel on bailout so libzip can unwind and clean up.
While at it, apply the same guard to the progress callback, which is
invoked from libzip the same way and is prone to the identical leak.1 parent 9596ab1 commit 0e87ea3
1 file changed
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2910 | 2910 | | |
2911 | 2911 | | |
2912 | 2912 | | |
2913 | | - | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
2914 | 2917 | | |
2915 | 2918 | | |
2916 | 2919 | | |
| |||
2957 | 2960 | | |
2958 | 2961 | | |
2959 | 2962 | | |
2960 | | - | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
2961 | 2970 | | |
2962 | 2971 | | |
2963 | 2972 | | |
| |||
0 commit comments