From 6556442d4629315dc6ba791705581d7bfc3c7ad7 Mon Sep 17 00:00:00 2001 From: GlyphTheWolf Date: Thu, 13 Jan 2022 20:41:10 +0100 Subject: [PATCH] Fix for RegEx.search() memory leak on Windows --- modules/regex/regex.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp index 62555e7f3ad..6dd4fa73e73 100644 --- a/modules/regex/regex.cpp +++ b/modules/regex/regex.cpp @@ -246,6 +246,8 @@ Ref RegEx::search(const String &p_subject, int p_offset, int p_end) if (res < 0) { pcre2_match_data_free_16(match); + pcre2_match_context_free_16(mctx); + return nullptr; }