From e09a820b19c06b2da3302680f51e4af07435462f Mon Sep 17 00:00:00 2001 From: Scott MacVicar Date: Thu, 29 Jan 2009 23:01:40 +0000 Subject: [PATCH] MFB Fix bug #47245 - Double free in mb_detect_encoding() --- ext/mbstring/mbstring.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 42d1324992..5c3255b829 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -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; } } -- 2.50.1