diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2017-07-20 18:09:05 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2017-07-20 18:12:04 +0200 |
commit | 77cb7bd837b128340fe9a2511681dd0d3c7222c5 (patch) | |
tree | 71aa2607cc99b185f402fd64ada071e58a53f6b8 /ext/mbstring/mbstring.c | |
parent | 5e56d050e582d845e977377a1f8ba8deb15ab082 (diff) | |
download | php-git-77cb7bd837b128340fe9a2511681dd0d3c7222c5.tar.gz |
Free last_used_encoding_name in RSHUTDOWN
efree() cannot be used in GSHUTDOWN
Diffstat (limited to 'ext/mbstring/mbstring.c')
-rw-r--r-- | ext/mbstring/mbstring.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 44a8a1da4c..9674a8371a 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -1577,9 +1577,6 @@ static PHP_GSHUTDOWN_FUNCTION(mbstring) #if HAVE_MBREGEX php_mb_regex_globals_free(mbstring_globals->mb_regex_globals); #endif - if (mbstring_globals->last_used_encoding_name) { - efree(mbstring_globals->last_used_encoding_name); - } } /* }}} */ @@ -1723,6 +1720,11 @@ PHP_RSHUTDOWN_FUNCTION(mbstring) MBSTRG(http_input_identify_cookie) = NULL; MBSTRG(http_input_identify_string) = NULL; + if (MBSTRG(last_used_encoding_name)) { + efree(MBSTRG(last_used_encoding_name)); + MBSTRG(last_used_encoding_name) = NULL; + } + /* clear overloaded function. */ if (MBSTRG(func_overload)){ p = &(mb_ovld[0]); |