Răsfoiți Sursa

Fix for RegEx.search() memory leak on Windows

(cherry picked from commit 6556442d4629315dc6ba791705581d7bfc3c7ad7)
GlyphTheWolf 3 ani în urmă
părinte
comite
a47188f2ce
1 a modificat fișierele cu 2 adăugiri și 0 ștergeri
  1. 2 0
      modules/regex/regex.cpp

+ 2 - 0
modules/regex/regex.cpp

@@ -246,6 +246,8 @@ Ref<RegExMatch> 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;
 		}