mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
MFB Fix bug #47245 - Double free in mb_detect_encoding()
This commit is contained in:
parent
71b236d7a0
commit
e09a820b19
1 changed files with 2 additions and 0 deletions
|
@ -3018,6 +3018,7 @@ PHP_FUNCTION(mb_detect_encoding)
|
|||
if (!php_mb_parse_encoding_array(encoding_list, &list, &size, 0 TSRMLS_CC)) {
|
||||
if (list) {
|
||||
efree(list);
|
||||
list = NULL;
|
||||
size = 0;
|
||||
}
|
||||
}
|
||||
|
@ -3027,6 +3028,7 @@ PHP_FUNCTION(mb_detect_encoding)
|
|||
if (!php_mb_parse_encoding_list(Z_STRVAL_P(encoding_list), Z_STRLEN_P(encoding_list), &list, &size, 0 TSRMLS_CC)) {
|
||||
if (list) {
|
||||
efree(list);
|
||||
list = NULL;
|
||||
size = 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue