diff options
Diffstat (limited to 'src/config.c')
| -rw-r--r-- | src/config.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/config.c b/src/config.c index c9543b7..3f7da08 100644 --- a/src/config.c +++ b/src/config.c @@ -223,11 +223,13 @@ static bool config_read_list(const char *value, char ***result) *end = '\0'; if (!config_read_string(token, &list[n++])) { + free(copy); free(list); return false; } } + free(copy); list[n] = NULL; *result = list; return true; @@ -568,24 +570,29 @@ bool config_resolve_children(config_t *config, block_t *block) if (!strcmp(children[i], config->blocks[j]->label)) { if (config->blocks[j]->resolved) { log_error("Block '%s' can only be referenced by one block", config->blocks[j]->label); - return false; + goto error; } log_debug("Block '%s' is parent of '%s'", block->label, config->blocks[j]->label); group->children[i] = config->blocks[j]; if (!config_resolve_children(config, config->blocks[j])) - return false; + goto error; goto next; } } log_error("Block '%s' not found", children[i]); - return false; + goto error; next: } + strfree(children); return true; + +error: + strfree(children); + return false; } block_t *config_resolve(config_t *config) |
