From 9d4190a5cc426dfbb515526d3c0b22c418e07d16 Mon Sep 17 00:00:00 2001 From: Miran Date: Thu, 16 May 2019 21:06:31 +0200 Subject: fixes #11139 (re.nim memory leak) (#11265) Use the same PCRE function for freeing up the memory as nre.nim does. --- lib/impure/re.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/impure/re.nim') diff --git a/lib/impure/re.nim b/lib/impure/re.nim index 4f32cd5fb..34ccd8f1a 100644 --- a/lib/impure/re.nim +++ b/lib/impure/re.nim @@ -65,7 +65,7 @@ proc finalizeRegEx(x: Regex) = # Fortunately the implementation is unlikely to change. pcre.free_substring(cast[cstring](x.h)) if not isNil(x.e): - pcre.free_substring(cast[cstring](x.e)) + pcre.free_study(x.e) proc re*(s: string, flags = {reStudy}): Regex = ## Constructor of regular expressions. -- cgit 1.4.1-2-gfad0