Skip to content

Commit

Permalink
Fix memory leak for invalid regex
Browse files Browse the repository at this point in the history
  • Loading branch information
miloyip committed Apr 16, 2016
1 parent 26e69ff commit e7149d6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/rapidjson/schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,7 @@ class Schema {
RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString());
if (!r->IsValid()) {
r->~RegexType();
AllocatorType::Free(r);
r = 0;
}
return r;
Expand Down

0 comments on commit e7149d6

Please sign in to comment.