summaryrefslogtreecommitdiff
path: root/ext/ftp/php_ftp.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-11-04 20:56:47 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-11-04 20:56:47 +0000
commit046904f2b159a628b009a28ec71865394fdcea88 (patch)
treec6b8b0fd06a32f426d8226a2f698b3fe052e13ab /ext/ftp/php_ftp.c
parent68bab385cb0eb318bf3044b0cd68e71b527a829f (diff)
downloadphp-git-046904f2b159a628b009a28ec71865394fdcea88.tar.gz
Fixed bug #26113 (remove leftover local file when ftp_get/ftp_nb_get fails)
Diffstat (limited to 'ext/ftp/php_ftp.c')
-rw-r--r--ext/ftp/php_ftp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c
index e6a496a2ce..21a0cf52a5 100644
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@ -710,6 +710,7 @@ PHP_FUNCTION(ftp_get)
if (!ftp_get(ftp, outstream, remote, xtype, resumepos TSRMLS_CC)) {
php_stream_close(outstream);
+ VCWD_UNLINK(local);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf);
RETURN_FALSE;
}
@@ -772,6 +773,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);
}