]> granicus.if.org Git - php/commitdiff
Fix bug #47245 - Double free in mb_detect_encoding()
authorScott MacVicar <scottmac@php.net>
Thu, 29 Jan 2009 22:58:52 +0000 (22:58 +0000)
committerScott MacVicar <scottmac@php.net>
Thu, 29 Jan 2009 22:58:52 +0000 (22:58 +0000)
ext/mbstring/mbstring.c

index 8c0ac175b8c3c2445422b98b38782dfffd9a62de..ed186255d09141e6ef3fd9c3bfe653078cead1f8 100644 (file)
@@ -2666,6 +2666,7 @@ PHP_FUNCTION(mb_detect_encoding)
                        if (!php_mb_parse_encoding_array(*arg_list, &list, &size, 0 TSRMLS_CC)) {
                                if (list) {
                                        efree(list);
+                                       list = NULL;
                                        size = 0;
                                }
                        }
@@ -2675,6 +2676,7 @@ PHP_FUNCTION(mb_detect_encoding)
                        if (!php_mb_parse_encoding_list(Z_STRVAL_PP(arg_list), Z_STRLEN_PP(arg_list), &list, &size, 0 TSRMLS_CC)) {
                                if (list) {
                                        efree(list);
+                                       list = NULL;
                                        size = 0;
                                }
                        }