summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/gd/gd.c10
-rw-r--r--ext/gd/libgd/gd_io_dp.c7
2 files changed, 7 insertions, 10 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 0a367e5a34..2bced6403d 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -1212,9 +1212,9 @@ static const char php_sig_gd2[3] = {'g', 'd', '2'};
static int _php_image_type (char data[8])
{
#ifdef HAVE_LIBGD15
- /* Based on ext/standard/images.c */
+ /* Based on ext/standard/image.c */
- if (data == NULL || strlen(data) <= 0)
+ if (data == NULL)
return -1;
if (!memcmp(data, php_sig_gd2, 3))
@@ -1273,7 +1273,11 @@ gdImagePtr _php_image_create_from_string(zval **data, char *tn, gdImagePtr (*ioc
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed data is not in '%s' format", tn);
return NULL;
}
-
+#if HAVE_LIBGD204
+ io_ctx->gd_free(io_ctx);
+#else
+ io_ctx->free(io_ctx);
+#endif
return im;
}
/* }}} */
diff --git a/ext/gd/libgd/gd_io_dp.c b/ext/gd/libgd/gd_io_dp.c
index c41743e78f..06c3ae80b6 100644
--- a/ext/gd/libgd/gd_io_dp.c
+++ b/ext/gd/libgd/gd_io_dp.c
@@ -145,13 +145,6 @@ gdFreeDynamicCtx (struct gdIOCtx *ctx)
gdFree (ctx);
- /* clean up the data block and return it */
- if (dp->data != NULL)
- {
- gdFree (dp->data);
- dp->data = NULL;
- }
-
dp->realSize = 0;
dp->logicalSize = 0;