diff --git a/src/mworker-prog.c b/src/mworker-prog.c index 467ce9b24..ba52406e9 100644 --- a/src/mworker-prog.c +++ b/src/mworker-prog.c @@ -230,22 +230,24 @@ int cfg_parse_program(const char *file, int linenum, char **args, int kwm) return err_code; error: - LIST_DEL(&ext_child->list); - if (ext_child->command) { - int i; + if (ext_child) { + LIST_DEL(&ext_child->list); + if (ext_child->command) { + int i; - for (i = 0; ext_child->command[i]; i++) { - if (ext_child->command[i]) { - free(ext_child->command[i]); - ext_child->command[i] = NULL; + for (i = 0; ext_child->command[i]; i++) { + if (ext_child->command[i]) { + free(ext_child->command[i]); + ext_child->command[i] = NULL; + } } + free(ext_child->command); + ext_child->command = NULL; + } + if (ext_child->id) { + free(ext_child->id); + ext_child->id = NULL; } - free(ext_child->command); - ext_child->command = NULL; - } - if (ext_child->id) { - free(ext_child->id); - ext_child->id = NULL; } free(ext_child);