fix: leak in ServerConfig class

This commit is contained in:
Talyx
2022-02-19 23:01:03 +03:00
parent b8f671d526
commit 5c2888190c
2 changed files with 47 additions and 3 deletions

View File

@@ -72,10 +72,13 @@ void Server::readConfig(char *filename)
arr = parser.root->find("server")->second->getMapArray();
it = arr->begin();
ServerConfig *tmp;
while (it != arr->end())
{
_configs.push_back(new ServerConfig(*it));
tmp = new ServerConfig(*it);
_configs.push_back(tmp);
tmp->fillFields();
++it;
}
@@ -309,7 +312,6 @@ void Server::start(void)
else if (events & EPOLLOUT)
{
/* DBOUT << GREEN << "doing sendData" << ENDL; */
client_map[fd]->printClientInfo();
sendData(*client_map[fd], fd);
if (client_map[fd]->allSended())
{