iliaa Thu Sep 28 23:18:29 2006 UTC
Modified files:
/php-src/ext/gd gd.c
Log:
MFB: Fixed a large leak inside _php_image_create_from()
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/gd.c?r1=1.354&r2=1.355&diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.354 php-src/ext/gd/gd.c:1.355
--- php-src/ext/gd/gd.c:1.354 Tue Aug 1 22:41:33 2006
+++ php-src/ext/gd/gd.c Thu Sep 28 23:18:29 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.354 2006/08/01 22:41:33 tony2001 Exp $ */
+/* $Id: gd.c,v 1.355 2006/09/28 23:18:29 iliaa Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -2212,6 +2212,7 @@
io_ctx = gdNewDynamicCtxEx(buff_size, buff, 0);
if (!io_ctx) {
+ pefree(buff, 1);
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot
allocate GD IO context");
goto out_err;
}
@@ -2222,6 +2223,7 @@
im = (*ioctx_func_p)(io_ctx);
}
io_ctx->gd_free(io_ctx);
+ pefree(buff, 1);
} else {
/* try and force the stream to be FILE* */
if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO |
PHP_STREAM_CAST_TRY_HARD, (void **) &fp, REPORT_ERRORS)) {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php