sterling Thu Dec 26 15:52:42 2002 EDT
Modified files:
/php4/ext/standard string.c
Log:
if needle is empty free allocated memory
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.337 php4/ext/standard/string.c:1.338
--- php4/ext/standard/string.c:1.337 Thu Dec 26 14:56:44 2002
+++ php4/ext/standard/string.c Thu Dec 26 15:52:42 2002
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.337 2002/12/26 19:56:44 sterling Exp $ */
+/* $Id: string.c,v 1.338 2002/12/26 20:52:42 sterling Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -1352,6 +1352,9 @@
if (Z_TYPE_PP(needle) == IS_STRING) {
if (!Z_STRLEN_PP(needle)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty
delimiter.");
+ efree(haystack_orig);
+ zval_ptr_dtor(haystack);
+ zval_ptr_dtor(needle);
RETURN_FALSE;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php