mirror of git://git.sv.gnu.org/nano.git
memory: do not allocate space for multidata when it's already allocated
Allocating it again would leak the existing space.
This fixes https://savannah.gnu.org/bugs/?60172.
Reported-by: Mike Frysinger <vapier@gentoo.org>
Bug existed since version 5.6, commit 1fdd23d3
.
This commit is contained in:
parent
be9b1a1887
commit
49ca7e5aa8
|
@ -305,7 +305,8 @@ void precalc_multicolorinfo(void)
|
|||
|
||||
/* For each line, allocate cache space for the multiline-regex info. */
|
||||
for (line = openfile->filetop; line != NULL; line = line->next)
|
||||
line->multidata = nmalloc(openfile->syntax->nmultis * sizeof(short));
|
||||
if (!line->multidata)
|
||||
line->multidata = nmalloc(openfile->syntax->nmultis * sizeof(short));
|
||||
|
||||
for (ink = openfile->syntax->color; ink != NULL; ink = ink->next) {
|
||||
/* If this is not a multi-line regex, skip it. */
|
||||
|
|
Loading…
Reference in New Issue