summaryrefslogtreecommitdiff
path: root/sent.c
diff options
context:
space:
mode:
Diffstat (limited to 'sent.c')
-rw-r--r--sent.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sent.c b/sent.c
index a4d0cd2..1e1353c 100644
--- a/sent.c
+++ b/sent.c
@@ -185,12 +185,16 @@ ffload(Slide *s)
for (i = 0; i < LEN(filters); i++) {
if (regcomp(&regex, filters[i].regex,
- REG_NOSUB | REG_EXTENDED | REG_ICASE))
+ REG_NOSUB | REG_EXTENDED | REG_ICASE)) {
+ fprintf(stderr, "sent: Invalid regex '%s'\n", filters[i].regex);
continue;
+ }
if (!regexec(&regex, filename, 0, NULL, 0)) {
bin = filters[i].bin;
+ regfree(&regex);
break;
}
+ regfree(&regex);
}
if (!bin)
die("sent: Unable to find matching filter for file %s", filename);