k += colormatches[0].rm_eo;
}
+ regfree(&color_regexp);
+
}
/* Now, if there's an 'end' somewhere below, and a 'start'
somewhere above, things get really fun. We have to look
while (s != NULL) {
regcomp(&color_regexp, tmpcolor->start, 0);
if (!regexec
- (&color_regexp, s->data, 1, colormatches, 0))
+ (&color_regexp, s->data, 1, colormatches, 0)) {
+ regfree(&color_regexp);
break;
+ }
s = s->prev;
+ regfree(&color_regexp);
}
if (s != NULL) {
while (e != NULL && e != fileptr) {
regcomp(&color_regexp, tmpcolor->end, 0);
if (!regexec
- (&color_regexp, e->data, 1, colormatches, 0))
+ (&color_regexp, e->data, 1, colormatches, 0)) {
+ regfree(&color_regexp);
break;
+ }
e = e->next;
+ regfree(&color_regexp);
}
if (e != fileptr)
regcomp(&color_regexp, tmpcolor->end, 0);
if (!regexec
(&color_regexp, e->data, 1, colormatches,
- 0))
+ 0)) {
+ regfree(&color_regexp);
break;
+ }
e = e->next;
+ regfree(&color_regexp);
}
if (e == NULL)
regcomp(&color_regexp, tmpcolor->end, 0);
if (!regexec
(&color_regexp, e->data, 1,
- colormatches, 0))
+ colormatches, 0)) {
+ regfree(&color_regexp);
break;
- e = e->next;
+ } e = e->next;
+ regfree(&color_regexp);
}
if (e == NULL)
}
}
+
#endif /* ENABLE_COLOR */
#ifndef NANO_SMALL