for (i = 0; i < len; ++i) {
if (regcomp(®ex, assocs[i].regex, REG_NOSUB | REG_EXTENDED | REG_ICASE) != 0)
continue;
- if (regexec(®ex, file, 0, NULL, 0) == 0)
+ if (regexec(®ex, file, 0, NULL, 0) == 0) {
+ regfree(®ex);
return assocs[i].mime;
+ }
}
+ regfree(®ex);
return NULL;
}
return -1;
fill(&dents, visible, &re);
+ regfree(&re);
+
qsort(dents, ndents, sizeof(*dents), entrycmp);
return 0;
#endif
ndents = dentfill(path, &dents, visible, &re);
+ regfree(&re);
qsort(dents, ndents, sizeof(*dents), entrycmp);
/* Find cur from history */
cur = dentfind(dents, oldname, ndents);
- regfree(&re);
return 0;
}