File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -932,7 +932,15 @@ mysqlnd_net_free(MYSQLND_NET * const net TSRMLS_DC)
932
932
if (net -> stream ) {
933
933
DBG_INF_FMT ("Freeing stream. abstract=%p" , net -> stream -> abstract );
934
934
if (pers ) {
935
- php_stream_free (net -> stream , PHP_STREAM_FREE_CLOSE_PERSISTENT | PHP_STREAM_FREE_RSRC_DTOR );
935
+ if (EG (active )) {
936
+ php_stream_free (net -> stream , PHP_STREAM_FREE_CLOSE_PERSISTENT | PHP_STREAM_FREE_RSRC_DTOR );
937
+ } else {
938
+ /*
939
+ otherwise we will crash because the EG(persistent_list) has been freed already,
940
+ before the modules are shut down
941
+ */
942
+ php_stream_free (net -> stream , PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_RSRC_DTOR );
943
+ }
936
944
} else {
937
945
php_stream_free (net -> stream , PHP_STREAM_FREE_CLOSE );
938
946
}
You can’t perform that action at this time.
0 commit comments