sesser Tue Sep 19 11:34:19 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/main rfc1867.c Log: Delete empty temporary files if file upload hook forbids the upload http://cvs.php.net/viewvc.cgi/php-src/main/rfc1867.c?r1=1.173.2.1.2.3&r2=1.173.2.1.2.4&diff_format=u Index: php-src/main/rfc1867.c diff -u php-src/main/rfc1867.c:1.173.2.1.2.3 php-src/main/rfc1867.c:1.173.2.1.2.4 --- php-src/main/rfc1867.c:1.173.2.1.2.3 Sat Sep 9 22:06:27 2006 +++ php-src/main/rfc1867.c Tue Sep 19 11:34:19 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: rfc1867.c,v 1.173.2.1.2.3 2006/09/09 22:06:27 rasmus Exp $ */ +/* $Id: rfc1867.c,v 1.173.2.1.2.4 2006/09/19 11:34:19 sesser Exp $ */ /* * This product includes software developed by the Apache Group @@ -1033,6 +1033,14 @@ event_file_start.filename = &filename; if (php_rfc1867_callback(MULTIPART_EVENT_FILE_START, &event_file_start, &event_extra_data TSRMLS_CC) == FAILURE) { skip_upload = 1; + if (temp_filename) { + if (cancel_upload != UPLOAD_ERROR_E) { /* file creation failed */ + close(fd); + unlink(temp_filename); + } + efree(temp_filename); + } + temp_filename=""; } }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php