From: Michael Stapelberg Date: Mon, 28 Aug 2017 07:22:38 +0000 (+0200) Subject: Fix memleak: free regex when parsing fails X-Git-Tag: 4.14~3^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c4474adfd671703968977264a20cc0fe3f6e7e86;p=i3%2Fi3 Fix memleak: free regex when parsing fails fixes #2541 --- diff --git a/src/regex.c b/src/regex.c index 296b91dd..8f039157 100644 --- a/src/regex.c +++ b/src/regex.c @@ -38,6 +38,7 @@ struct regex *regex_new(const char *pattern) { } ELOG("PCRE regular expression compilation failed at %d: %s\n", offset, error); + regex_free(re); return NULL; } re->extra = pcre_study(re->regex, 0, &error);