Try to release as much memory as possible to be able to detect real memory leaks.

This commit is contained in:
Nikos Mavrogiannopoulos
2014-01-09 17:27:49 +01:00
parent 49b4eaa7dd
commit cdba1ae374
6 changed files with 77 additions and 46 deletions
+8 -1
View File
@@ -517,7 +517,7 @@ int cmd_parser (int argc, char **argv, struct cfg_st* config)
}
#define DEL(x) free(x);x=NULL
void reload_cfg_file(struct cfg_st* config)
void clear_cfg_file(struct cfg_st* config)
{
unsigned i;
@@ -566,6 +566,13 @@ unsigned i;
DEL(config->cert);
DEL(config->network.routes);
return;
}
void reload_cfg_file(struct cfg_st* config)
{
clear_cfg_file(config);
memset(config, 0, sizeof(*config));
parse_cfg_file(cfg_file, config);