summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-06-25 12:09:47 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-07-15 15:19:31 +0200
commit88ffe0579726f7ba1985c9223e6005c581032757 (patch)
treed7c39acaf2cd6ec2fe984c644c644b424406af62
parenteab0079c902a9a52773c6bb63b57555dee45b3ab (diff)
downloadphp-git-88ffe0579726f7ba1985c9223e6005c581032757.tar.gz
Fix bug #77124
This is a backport of 6fcae63f614d1ed4aaeaff7b13a7a4627b1f1312 to PHP 7.2.
-rw-r--r--NEWS3
-rw-r--r--ext/ftp/ftp.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index be4b60888f..d04dc6b79b 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,9 @@ PHP NEWS
. Fixed bug #78183 (finfo_file shows wrong mime-type for .tga file).
(Joshua Westerheide)
+- FTP:
+ . Fixed bug #77124 (FTP with SSL memory leak). (Nikita)
+
- PDO_Sqlite:
. Fixed bug #78192 (SegFault when reuse statement after schema has changed).
(Vincent Quatrevieux)
diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c
index 8f9f737678..28760349df 100644
--- a/ext/ftp/ftp.c
+++ b/ext/ftp/ftp.c
@@ -289,9 +289,10 @@ ftp_login(ftpbuf_t *ftp, const char *user, const size_t user_len, const char *pa
SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_BOTH);
ftp->ssl_handle = SSL_new(ctx);
+ SSL_CTX_free(ctx);
+
if (ftp->ssl_handle == NULL) {
php_error_docref(NULL, E_WARNING, "failed to create the SSL handle");
- SSL_CTX_free(ctx);
return 0;
}