1
0
mirror of https://git.sr.ht/~sircmpwn/gmni synced 2024-11-23 04:51:59 +01:00

Close fd after freeing SSL

BIO_free_all may trigger write to close the SSL connection
This commit is contained in:
Charles E. Lehner 2020-09-24 11:44:57 -04:00 committed by Drew DeVault
parent 59d19b9894
commit 689fb8b470

@ -236,11 +236,6 @@ gemini_response_finish(struct gemini_response *resp)
return;
}
if (resp->fd != -1) {
close(resp->fd);
resp->fd = -1;
}
if (resp->bio) {
BIO_free_all(resp->bio);
resp->bio = NULL;
@ -254,6 +249,11 @@ gemini_response_finish(struct gemini_response *resp)
}
free(resp->meta);
if (resp->fd != -1) {
close(resp->fd);
resp->fd = -1;
}
resp->ssl = NULL;
resp->ssl_ctx = NULL;
resp->meta = NULL;