Skip to content

Commit

Permalink
Fix bug #77124
Browse files Browse the repository at this point in the history
This is a backport of 6fcae63
to PHP 7.2.
  • Loading branch information
nikic committed Jul 15, 2019
1 parent eab0079 commit 88ffe05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion ext/ftp/ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 88ffe05

Please sign in to comment.