🔨」 fix: change a few thing in main and help to prevent leak

This commit is contained in:
2025-05-06 19:20:44 +02:00
parent 5ea07dd436
commit ec1299ccfa
3 changed files with 21 additions and 7 deletions

View File

@ -6,7 +6,7 @@
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/03 15:45:07 by mmoussou #+# #+# */
/* Updated: 2025/05/06 11:51:01 by adjoly ### ########.fr */
/* Updated: 2025/05/06 19:19:33 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
@ -40,20 +40,20 @@ void ft_sig(int sig) {
}
int main(int ac, char **av) {
_log = new Logger;
Logger log;
if (help(ac, av)) {
return EXIT_SUCCESS;
}
_log->info("Starting server...");
log.info("Starting server...");
if (access(av[1], F_OK) < 0) {
std::stringstream str;
str << "File : " << av[1] << " could not be opened";
_log->error(str.str());
log.error(str.str());
return EXIT_FAILURE;
}
delete _log;
_log = not_nullptr;
config::Config *conf;
try {
std::string str = av[1];