File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1160,8 +1160,8 @@ PHP_RSHUTDOWN_FUNCTION(mbstring)
11601160 MBSTRG (outconv_state ) = 0 ;
11611161
11621162 if (MBSTRG (all_encodings_list )) {
1163- GC_DELREF ( MBSTRG ( all_encodings_list ));
1164- zend_array_destroy (MBSTRG (all_encodings_list ));
1163+ /* must be *array* release to remove from GC root buffer and free the hashtable itself */
1164+ zend_array_release (MBSTRG (all_encodings_list ));
11651165 MBSTRG (all_encodings_list ) = NULL ;
11661166 }
11671167
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-19397 (mb_list_encodings() can cause crashes on shutdown)
3+ --EXTENSIONS--
4+ mbstring
5+ --FILE--
6+ <?php
7+ $ doNotDeleteThisVariableAssignment = mb_list_encodings ();
8+ var_dump (count ($ doNotDeleteThisVariableAssignment ) > 0 );
9+ ?>
10+ --EXPECT--
11+ bool(true)
You can’t perform that action at this time.
0 commit comments