From: Ilia Alshanetsky Date: Tue, 4 Nov 2003 20:56:56 +0000 (+0000) Subject: MFH: Fixed bug #26113 (remove leftover local file when ftp_get/ftp_nb_get X-Git-Tag: php-4.3.5RC1~239 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=40ffe5ed822aaa6af090478018dfc68a199c5e86;p=php MFH: Fixed bug #26113 (remove leftover local file when ftp_get/ftp_nb_get fails). --- diff --git a/NEWS b/NEWS index 7e4748348c..8e1b5a71d0 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP 4 NEWS ?? ??? 2003, Version 4.3.5 - Fixed header handler in NSAPI SAPI module (header->replace was ignored, send_default_content_type now sends value from php.ini). (Uwe Schindler) +- Fixed bug #26113 (remove leftover local file when ftp_get/ftp_nb_get fails). + (Ilia) - Fixed bug #26105 (Compile failure on gcc version 3.0.X). (Ilia) - Fixed bug #26103 (ext/mime_magic causes compile failure in ext/mssql). (Jani) - Fixed bug #26097 (gdImageColorClosestAlpha() returns incorrect results). diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index c286e6ed65..6474115cb8 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -636,6 +636,7 @@ PHP_FUNCTION(ftp_get) if (!ftp_get(ftp, outstream, remote, xtype, resumepos)) { php_stream_close(outstream); + VCWD_UNLINK(local); php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_FALSE; } @@ -711,6 +712,7 @@ PHP_FUNCTION(ftp_nb_get) if ((ret = ftp_nb_get(ftp, outstream, remote, xtype, resumepos TSRMLS_CC)) == PHP_FTP_FAILED) { php_stream_close(outstream); + VCWD_UNLINK(local); php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_LONG(PHP_FTP_FAILED); }