]> granicus.if.org Git - php/commitdiff
Fixed a large leak inside _php_image_create_from()
authorIlia Alshanetsky <iliaa@php.net>
Thu, 28 Sep 2006 23:17:31 +0000 (23:17 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 28 Sep 2006 23:17:31 +0000 (23:17 +0000)
ext/gd/gd.c

index 33d3c312f87a4704805ef5f6bc6237a28a364852..f42b06fec9b3f0aadf8a828d3625990c0af79631 100644 (file)
@@ -2406,6 +2406,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
 
                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;
                }
@@ -2420,7 +2421,7 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
 #else
                io_ctx->free(io_ctx);
 #endif
-
+               pefree(buff, 1);
 #endif
        }
        else {