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)
1160
1160
MBSTRG (outconv_state ) = 0 ;
1161
1161
1162
1162
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 ));
1165
1165
MBSTRG (all_encodings_list ) = NULL ;
1166
1166
}
1167
1167
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