dmitry Mon Aug 15 04:11:38 2005 EDT Modified files: /php-src/ext/standard string.c Log: Fixed trim()'s memory leak in unicode mode http://cvs.php.net/diff.php/php-src/ext/standard/string.c?r1=1.451&r2=1.452&ty=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.451 php-src/ext/standard/string.c:1.452 --- php-src/ext/standard/string.c:1.451 Fri Aug 12 12:46:38 2005 +++ php-src/ext/standard/string.c Mon Aug 15 04:11:35 2005 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c,v 1.451 2005/08/12 16:46:38 tony2001 Exp $ */ +/* $Id: string.c,v 1.452 2005/08/15 08:11:35 dmitry Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -713,17 +713,18 @@ if ( start < len ) { if ( return_value ) { RETVAL_UNICODEL(c+start, end-start+1, 1); + return NULL; } else { return eustrndup(c+start, end-start+1); } } else { /* Trimmed the whole string */ if ( return_value ) { RETVAL_EMPTY_UNICODE(); + return NULL; } else { return (USTR_MAKE("")); } } - return (USTR_MAKE("")); } /* }}} */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php