Skip to content

Commit 88ffe05

Browse files
committed
Fix bug #77124
This is a backport of 6fcae63 to PHP 7.2.
1 parent eab0079 commit 88ffe05

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ PHP NEWS
66
. Fixed bug #78183 (finfo_file shows wrong mime-type for .tga file).
77
(Joshua Westerheide)
88

9+
- FTP:
10+
. Fixed bug #77124 (FTP with SSL memory leak). (Nikita)
11+
912
- PDO_Sqlite:
1013
. Fixed bug #78192 (SegFault when reuse statement after schema has changed).
1114
(Vincent Quatrevieux)

ext/ftp/ftp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,10 @@ ftp_login(ftpbuf_t *ftp, const char *user, const size_t user_len, const char *pa
289289
SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_BOTH);
290290

291291
ftp->ssl_handle = SSL_new(ctx);
292+
SSL_CTX_free(ctx);
293+
292294
if (ftp->ssl_handle == NULL) {
293295
php_error_docref(NULL, E_WARNING, "failed to create the SSL handle");
294-
SSL_CTX_free(ctx);
295296
return 0;
296297
}
297298

0 commit comments

Comments
 (0)