From a5741100482eb50bb00ac0f8d22198277cd41fa5 Mon Sep 17 00:00:00 2001 From: Alastair Murray Date: Tue, 9 Feb 2016 13:08:56 +0000 Subject: [PATCH] Close a memory leak in configuration code This was causing configuration failures on address sanitizer builds. --- cmake/posix_regex.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/posix_regex.cpp b/cmake/posix_regex.cpp index a31af804..466dc625 100644 --- a/cmake/posix_regex.cpp +++ b/cmake/posix_regex.cpp @@ -7,6 +7,8 @@ int main() { if (ec != 0) { return ec; } - return regexec(&re, str.c_str(), 0, nullptr, 0) ? -1 : 0; + int ret = regexec(&re, str.c_str(), 0, nullptr, 0) ? -1 : 0; + regfree(&re); + return ret; }