mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-10-14 02:22:03 +08:00
Try to release as much memory as possible to be able to detect real memory leaks.
This commit is contained in:
+8
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user