fix memory leak in read_config_file

This commit is contained in:
Thibaut Ackermann 2018-10-02 15:28:37 +02:00
parent 5d88f8275d
commit 58947cc531

View File

@ -1604,7 +1604,7 @@ static void read_config_file(int argc, char **argv, int pass)
if (full_path_to_config_file)
f = fopen(full_path_to_config_file, "r");
if (f && full_path_to_config_file) {
if (f) {
char sbuf[1025];
char sarg[1035];
@ -1653,6 +1653,11 @@ static void read_config_file(int argc, char **argv, int pass)
} else
TURN_LOG_FUNC(TURN_LOG_LEVEL_WARNING, "WARNING: Cannot find config file: %s. Default and command-line settings will be used.\n",
config_file);
if (full_path_to_config_file) {
free(full_path_to_config_file);
full_path_to_config_file = NULL;
}
}
}