1
0
Fork 1

Prevent double free of client resources

This commit is contained in:
Drew DeVault 2020-11-08 16:37:53 -05:00
parent ea2914efff
commit 74077b6f95
1 changed files with 4 additions and 0 deletions

View File

@ -188,13 +188,17 @@ disconnect_client(struct gmnisrv_server *server, struct gmnisrv_client *client)
}
if (client->ssl) {
SSL_free(client->ssl);
client->ssl = NULL;
}
if (client->body) {
fclose(client->body);
client->body = NULL;
}
close(client->sockfd);
free(client->meta);
client->meta = NULL;
free(client->path);
client->path = NULL;
size_t index = (client - server->clients) / sizeof(struct gmnisrv_client);
memmove(&server->clients[index],