Introduction
Introduction Statistics Contact Development Disclaimer Help
Fix memory leak and print a warning on invalid regex - sent - simple plaintext …
git clone git://git.suckless.org/sent
Log
Files
Refs
README
LICENSE
---
commit 072a318adbdf091a58587c740d081d0ccfff271c
parent e8914d5d4bedb12bccf78a930b34b1564b3dbaac
Author: FRIGN <[email protected]>
Date: Thu, 11 Aug 2016 21:30:34 +0200
Fix memory leak and print a warning on invalid regex
This will minimize the already low memory usage of sent.
Diffstat:
M sent.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git 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[…
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", filena…
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.