iliaa Tue Nov 2 11:41:41 2004 EDT
Modified files:
/php-src/ext/gd gd.c
Log:
MFB: Fixed bug #30658 (Ensure that temporary files created by GD are removed).
http://cvs.php.net/diff.php/php-src/ext/gd/gd.c?r1=1.298&r2=1.299&ty=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.298 php-src/ext/gd/gd.c:1.299
--- php-src/ext/gd/gd.c:1.298 Mon Aug 16 19:07:42 2004
+++ php-src/ext/gd/gd.c Tue Nov 2 11:41:41 2004
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.298 2004/08/16 23:07:42 iliaa Exp $ */
+/* $Id: gd.c,v 1.299 2004/11/02 16:41:41 iliaa Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -1767,8 +1767,9 @@
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 @@
}
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;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php