fixes #11139 (re.nim memory leak) (#11265)

Use the same PCRE function for freeing up the memory as nre.nim does.
This commit is contained in:
Miran 2019-05-16 21:06:31 +02:00 • committed by Andreas Rumpf
commit 9d4190a5cc
2 changed files with 1 additions and 2 deletions

View file

@ -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.