tony2001                Thu Dec 21 01:13:50 2006 UTC

  Modified files:              
    /php-src/ext/standard       html.c 
  Log:
  fix leak on error
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/html.c?r1=1.119&r2=1.120&diff_format=u
Index: php-src/ext/standard/html.c
diff -u php-src/ext/standard/html.c:1.119 php-src/ext/standard/html.c:1.120
--- php-src/ext/standard/html.c:1.119   Wed Nov 22 22:18:46 2006
+++ php-src/ext/standard/html.c Thu Dec 21 01:13:50 2006
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: html.c,v 1.119 2006/11/22 22:18:46 andrei Exp $ */
+/* $Id: html.c,v 1.120 2006/12/21 01:13:50 tony2001 Exp $ */
 
 /*
  * HTML entity resources:
@@ -955,7 +955,8 @@
 
                                        default:
                                                php_error_docref(NULL 
TSRMLS_CC, E_WARNING, "cannot yet handle MBCS!");
-                                               return 0;
+                                               efree(ret);
+                                               return NULL;
                                }
 
                                if (php_memnstr(ret, entity, entity_length, 
ret+retlen)) {
@@ -1365,6 +1366,10 @@
 
        replaced = php_unescape_html_entities(str.s, str_len, &len, 1, 
quote_style, hint_charset TSRMLS_CC);
 
+       if (!replaced) {
+               RETURN_FALSE;
+       }
+
        if (type == IS_UNICODE) {
                RETVAL_U_STRINGL(UG(utf8_conv), replaced, len, ZSTR_AUTOFREE);
                efree(str_utf8);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to