summaryrefslogtreecommitdiff
path: root/ext/gd/gd_ctx.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/gd_ctx.c')
-rw-r--r--ext/gd/gd_ctx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c
index 80156e9004..7502cb0f4c 100644
--- a/ext/gd/gd_ctx.c
+++ b/ext/gd/gd_ctx.c
@@ -160,7 +160,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
RETURN_FALSE;
}
} else {
- ctx = emalloc(sizeof(gdIOCtx));
+ ctx = ecalloc(1, sizeof(gdIOCtx));
ctx->putC = _php_image_output_putc;
ctx->putBuf = _php_image_output_putbuf;
ctx->gd_free = _php_image_output_ctxfree;
@@ -173,7 +173,7 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
}
if (!ctx) {
- ctx = emalloc(sizeof(gdIOCtx));
+ ctx = ecalloc(1, sizeof(gdIOCtx));
ctx->putC = _php_image_stream_putc;
ctx->putBuf = _php_image_stream_putbuf;
if (close_stream) {