We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
template file:
<?xml version="1.0" encoding="UTF-8"?> <templates version="2.25" xmlns="http://www.fixprotocol.org/ns/template-definition"> <template id="1" name="FirstMessage"> <string id="1" name="ID" presence="optional"><copy/></string> </template> <template id="2" name="SecondMessage"> <string id="1" name="ID"><tail/></string> </template> </templates>
There are two ID fields in two different message, the first one has copy attribute and another has tail attribute.
ID
copy
tail
mFAST encoder will double free memory when encoding this template.
copy & tail attribute is the key point, the program will not crash when removing any of them.
I found a easy way to solve it :
diff --git a/src/mfast/coder/common/template_repo.h b/src/mfast/coder/common/template_repo.h index d949d56..b0fa690 100644 --- a/src/mfast/coder/common/template_repo.h +++ b/src/mfast/coder/common/template_repo.h @@ -18,6 +18,8 @@ public: if (elem->of_array.capacity_in_bytes_) dictionary_alloc_->deallocate(elem->of_array.content_, elem->of_array.capacity_in_bytes_); + elem->of_array.content_ = nullptr; + elem->of_array.capacity_in_bytes_ = 0; } }
I think it's just a workaround not the root cause?
The text was updated successfully, but these errors were encountered:
same as #123; occurs during dict cleanup, shall review solution, thx
Sorry, something went wrong.
No branches or pull requests
template file:
There are two
ID
fields in two different message, the first one hascopy
attribute and another hastail
attribute.mFAST encoder will double free memory when encoding this template.
copy
&tail
attribute is the key point, the program will not crash when removing any of them.I found a easy way to solve it :
I think it's just a workaround not the root cause?
The text was updated successfully, but these errors were encountered: