cvs: php-src(PHP_5_3) /ext/spl spl_dllist.c /ext/spl/tests bug46160.phpt
| From: | Felipe Pena | Date: | Tue, 23 Sep 2008 12:06:01 +0000 |
| Subject: | cvs: php-src(PHP_5_3) /ext/spl spl_dllist.c /ext/spl/tests bug46160.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-53250@lists.php.net to get a copy of this message | ||
felipe Tue Sep 23 12:06:01 2008 UTC
Added files: (Branch: PHP_5_3)
/php-src/ext/spl/tests bug46160.phpt
Modified files:
/php-src/ext/spl spl_dllist.c
Log:
- MFH: Fixed bug #46160 (SPL - Memory leak when exception is throwed in offsetSet method)
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_dllist.c?r1=1.1.2.13&r2=1.1.2.14&diff_format=u
Index: php-src/ext/spl/spl_dllist.c
diff -u php-src/ext/spl/spl_dllist.c:1.1.2.13 php-src/ext/spl/spl_dllist.c:1.1.2.14
--- php-src/ext/spl/spl_dllist.c:1.1.2.13 Sun Jul 6 23:45:55 2008
+++ php-src/ext/spl/spl_dllist.c Tue Sep 23 12:06:01 2008
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_dllist.c,v 1.1.2.13 2008/07/06 23:45:55 colder Exp $ */
+/* $Id: spl_dllist.c,v 1.1.2.14 2008/09/23 12:06:01 felipe Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -818,6 +818,7 @@
index = spl_offset_convert_to_long(zindex TSRMLS_CC);
if (index < 0 || index >= intern->llist->count) {
+ zval_ptr_dtor(&value);
zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid or out of range", 0
TSRMLS_CC);
return;
}
@@ -840,6 +841,7 @@
intern->llist->ctor(element TSRMLS_CC);
}
} else {
+ zval_ptr_dtor(&value);
zend_throw_exception(spl_ce_OutOfRangeException, "Offset invalid", 0 TSRMLS_CC);
return;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/bug46160.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/bug46160.phpt
+++ php-src/ext/spl/tests/bug46160.phpt
--TEST--
Bug #46160 (SPL - Memory leak when exception is throwed in offsetSet method)
--FILE--
<?php
try {
$x = new splqueue;
$x->offsetSet(0, 0);
} catch (Exception $e) { }
?>
DONE
--EXPECT--
DONE