cvs: ZendEngine2 / zend_unicode.c php-src NEWS
| From: | Dmitry Stogov | Date: | Fri, 24 Mar 2006 10:11:49 +0000 |
| Subject: | cvs: ZendEngine2 / zend_unicode.c php-src NEWS | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4763@lists.php.net to get a copy of this message | ||
dmitry Fri Mar 24 10:11:49 2006 UTC
Modified files:
/php-src NEWS
/ZendEngine2 zend_unicode.c
Log:
Fixed bug #36840 (Memory leak if cast operator throws an exception that is caught)
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2108&r2=1.2109&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2108 php-src/NEWS:1.2109
--- php-src/NEWS:1.2108 Sun Mar 19 11:26:25 2006
+++ php-src/NEWS Fri Mar 24 10:11:49 2006
@@ -43,5 +43,7 @@
the part of haystack before or after first occurence of needle. (Johannes)
- Added possibility to check in which extension an internal function was
defined using reflection API. (Johannes)
+- Fixed bug #36840 (Memory leak if cast operator throws an exception that is
+ caught). (Dmitry)
- Fixed bug #36630 (umask not reset at the end of the request). (Ilia)
- Fixed bug #34286 (__toString() behavior is inconsistent). (Marcus)
http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_unicode.c?r1=1.11&r2=1.12&diff_format=u
Index: ZendEngine2/zend_unicode.c
diff -u ZendEngine2/zend_unicode.c:1.11 ZendEngine2/zend_unicode.c:1.12
--- ZendEngine2/zend_unicode.c:1.11 Fri Mar 24 07:38:07 2006
+++ ZendEngine2/zend_unicode.c Fri Mar 24 10:11:49 2006
@@ -374,14 +374,18 @@
num_conv = zend_convert_from_unicode(conv, &s, &s_len, u, u_len, &status);
- ZVAL_STRINGL(string, s, s_len, 0);
-
if (U_FAILURE(status)) {
int32_t offset = u_countChar32(u, num_conv)-1;
+
+ if (s) {
+ efree(s);
+ }
zend_raise_conversion_error_ex("Could not convert Unicode string to binary
string", conv, offset, (UG(from_u_error_mode) & ZEND_CONV_ERROR_EXCEPTION) TSRMLS_CC);
retval = FAILURE;
}
+ ZVAL_STRINGL(string, s, s_len, 0);
+
efree((UChar*)u);
return retval;
}