Skip to content

Commit 08e3a18

Browse files
author
Huang-Ming Huang
committed
Fixed memory problem described in issue #62
1 parent 9bcf638 commit 08e3a18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mfast/xml_parser/templates_builder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ bool templates_builder::VisitExit(const XMLElement &element) {
143143
typedef const template_instruction *const_template_instruction_ptr_t;
144144

145145
definition_->instructions_ = new (alloc())
146-
const_template_instruction_ptr_t[this->num_instructions()];
146+
const_template_instruction_ptr_t[templates_.size()];
147147
std::copy(templates_.begin(), templates_.end(), definition_->instructions_);
148148
definition_->instructions_count_ = static_cast<uint32_t>(templates_.size());
149149
}

0 commit comments

Comments
 (0)