diff --git a/epicardium/modules/config.c b/epicardium/modules/config.c index 2e741b93ff41907e9ab05e0b9256fbc08e26a390..8c263fd1e1ba35d9716ea47bd8ced59d24f06dd5 100644 --- a/epicardium/modules/config.c +++ b/epicardium/modules/config.c @@ -246,6 +246,21 @@ void load_config(void) return; } + /* Clear any existing configuration */ + /* Don't free the blocks as we are most likely + * going to re-use all of them. */ + config_block *current; + if (config_data != NULL) { + current = config_data; + while (true) { + memset(current->slots, 0, sizeof(current->slots)); + if (current->next == NULL) { + break; + } + current = current->next; + } + } + char buf[128]; int nread; parser_state s;