Fix memory leak for invalid regex

This commit is contained in:
Milo Yip 2016-04-17 00:58:32 +08:00
parent 26e69ffde9
commit e7149d6659

View File

@ -1006,6 +1006,7 @@ private:
RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString());
if (!r->IsValid()) {
r->~RegexType();
AllocatorType::Free(r);
r = 0;
}
return r;