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:
parent
59d19b9894
commit
689fb8b470
10
src/client.c
10
src/client.c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user