mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
config: Plug some memory leaks in error handling.
(cherry picked from commit c92cd01e0b4b0c00d82ded4ba44ca6cbc0b54586)
This commit is contained in:
parent
ffb9321496
commit
3c000d2c2e
@ -229,7 +229,7 @@ parse_bind(struct option *opt_tree, unsigned char **file, int *line,
|
||||
keystroke = option_types[OPT_STRING].read(NULL, file, line);
|
||||
*file = skip_white(*file, line);
|
||||
if (!keystroke || !**file) {
|
||||
mem_free(keymap);
|
||||
mem_free(keymap); mem_free(keystroke);
|
||||
return ERROR_OPTION;
|
||||
}
|
||||
|
||||
@ -251,7 +251,7 @@ parse_bind(struct option *opt_tree, unsigned char **file, int *line,
|
||||
next_pos = *file;
|
||||
action = option_types[OPT_STRING].read(NULL, file, line);
|
||||
if (!action) {
|
||||
mem_free(keymap);
|
||||
mem_free(keymap); mem_free(keystroke);
|
||||
return ERROR_VALUE;
|
||||
}
|
||||
|
||||
@ -295,7 +295,10 @@ parse_include(struct option *opt_tree, unsigned char **file, int *line,
|
||||
if (!init_string(&dumbstring)) return ERROR_NOMEM;
|
||||
|
||||
*file = skip_white(*file, line);
|
||||
if (!*file) return ERROR_PARSE;
|
||||
if (!*file) {
|
||||
done_string(&dumbstring);
|
||||
return ERROR_PARSE;
|
||||
}
|
||||
|
||||
/* File name */
|
||||
fname = option_types[OPT_STRING].read(NULL, file, line);
|
||||
|
Loading…
x
Reference in New Issue
Block a user