From c4474adfd671703968977264a20cc0fe3f6e7e86 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 28 Aug 2017 09:22:38 +0200 Subject: [PATCH] Fix memleak: free regex when parsing fails fixes #2541 --- src/regex.c | 1 + 1 file changed, 1 insertion(+) 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);