diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2004-11-02 16:41:41 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2004-11-02 16:41:41 +0000 |
commit | 8091bfb84ce4c7c10006994c4bafc84da972d5cc (patch) | |
tree | 07e09b43eccb70457e2dd1ffab47bcaeda280718 | |
parent | 9a92e31cddb727b7bf45bca6d9e2a7f0ce608528 (diff) | |
download | php-git-8091bfb84ce4c7c10006994c4bafc84da972d5cc.tar.gz |
MFB: Fixed bug #30658 (Ensure that temporary files created by GD are removed).
-rw-r--r-- | ext/gd/gd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c index e716f9079a..1a00e92a17 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -1767,8 +1767,9 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char int b; FILE *tmp; char buf[4096]; + char *path; - tmp = php_open_temporary_file("", "", NULL TSRMLS_CC); + tmp = php_open_temporary_file("", "", &path TSRMLS_CC); if (tmp == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open temporary file"); RETURN_FALSE; @@ -1823,7 +1824,8 @@ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char } fclose(tmp); - /* the temporary file is automatically deleted */ + VCWD_UNLINK((const char *)path); /* make sure that the temporary file is removed */ + efree(path); } RETURN_TRUE; } |