com php-src: Free last_used_encoding_name in RSHUTDOW N: ext/mbstring/mbstring.c

From: Date: Thu, 20 Jul 2017 16:12:04 +0000
Subject: com php-src: Free last_used_encoding_name in RSHUTDOW N: ext/mbstring/mbstring.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-98662@lists.php.net to get a copy of this message
Commit: 77cb7bd837b128340fe9a2511681dd0d3c7222c5 Author: Nikita Popov <nikita.ppv@gmail.com> Thu, 20 Jul 2017 18:09:05 +0200 Parents: 5e56d050e582d845e977377a1f8ba8deb15ab082 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=77cb7bd837b128340fe9a2511681dd0d3c7222c5 Log: Free last_used_encoding_name in RSHUTDOWN efree() cannot be used in GSHUTDOWN Changed paths: M ext/mbstring/mbstring.c Diff: diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 44a8a1d..9674a83 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]);

« previous php.cvs (#98662) next »