1
1

tweaks: don't bother to free the content of 'extendsyntax' commands

Extending a syntax will be rather rare, so the amount of memory it
takes up will be minimal.  It's not worth the trouble to free this
memory -- it only takes time.  Plus: we don't bother to free the
memory of a syntax that gets fully redefined either.
Этот коммит содержится в:
Benno Schulenberg 2019-06-03 14:37:27 +02:00
родитель 7f3ffe8544
Коммит 5e1f90d8fa

Просмотреть файл

@ -584,7 +584,6 @@ void parse_one_include(char *file, syntaxtype *syntax)
while (extra != NULL) {
char *keyword = extra->data;
char *ptr = parse_next_word(extra->data);
augmentstruct *next = extra->next;
nanorc = extra->filename;
lineno = extra->lineno;
@ -592,16 +591,11 @@ void parse_one_include(char *file, syntaxtype *syntax)
if (!parse_syntax_commands(keyword, ptr))
rcfile_error(N_("Command \"%s\" not understood"), keyword);
free(extra->filename);
free(extra->data);
free(extra);
extra = next;
extra = extra->next;
}
free(syntax->filename);
syntax->filename = NULL;
syntax->augmentations = NULL;
opensyntax = FALSE;
}