summaryrefslogtreecommitdiff
path: root/ext/ftp/ftp.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/ftp/ftp.c')
-rw-r--r--ext/ftp/ftp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index a3601c0edd..c3a1126cae 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -1620,6 +1620,8 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
/* some servers don't open a ftp-data connection if the directory is empty */
if (ftp->resp == 226) {
+ ftp->data = data_close(ftp, data);
+ php_stream_close(tmpstream);
return ecalloc(1, sizeof(char**));
}