From 5cbcd53f8a978bef3e83a2ab2342cb2af705b2a1 Mon Sep 17 00:00:00 2001 From: "ager@chromium.org" Date: Mon, 15 Jun 2009 06:27:33 +0000 Subject: [PATCH] Fix memory leak in regexp macro assembler. If the buffer has been expanded the macro assembler owns the buffer and needs to dispose it in the destructor. Review URL: http://codereview.chromium.org/126111 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2158 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/regexp-macro-assembler-irregexp.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/regexp-macro-assembler-irregexp.cc b/src/regexp-macro-assembler-irregexp.cc index b87c51f900..eea3c23eae 100644 --- a/src/regexp-macro-assembler-irregexp.cc +++ b/src/regexp-macro-assembler-irregexp.cc @@ -47,6 +47,7 @@ RegExpMacroAssemblerIrregexp::RegExpMacroAssemblerIrregexp(Vector buffer) RegExpMacroAssemblerIrregexp::~RegExpMacroAssemblerIrregexp() { if (backtrack_.is_linked()) backtrack_.Unuse(); + if (own_buffer_) buffer_.Dispose(); }