You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "bneradt (via GitHub)" <gi...@apache.org> on 2024/02/07 18:54:07 UTC
[PR] XPACK: Fix a ats_malloc/delete mismatch [trafficserver]
bneradt opened a new pull request, #11049:
URL: https://github.com/apache/trafficserver/pull/11049
An ASan run showed that in XpackDynamicTable we used ats_malloc for the table entries, but then delete it in the destructor. This fixes that mismatch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] XPACK: Fix a ats_malloc/delete mismatch [trafficserver]
Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt commented on code in PR #11049:
URL: https://github.com/apache/trafficserver/pull/11049#discussion_r1481943259
##########
src/proxy/hdrs/XPACK.cc:
##########
@@ -225,7 +225,7 @@ XpackDynamicTable::XpackDynamicTable(uint32_t size) : _maximum_size(size), _avai
XpackDynamicTable::~XpackDynamicTable()
{
if (this->_entries) {
- delete this->_entries;
+ ats_free(this->_entries);
Review Comment:
The malloc, for reference, is a few lines above in the constructor here:
https://github.com/apache/trafficserver/pull/11049/files#diff-c9759c90bdcbd117f1d5b745a67412066eff8162ec490431323162d74dcc908cR220
```cpp
this->_entries = static_cast<struct XpackDynamicTableEntry *>(ats_malloc(sizeof(struct XpackDynamicTableEntry) * size));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] XPACK: Fix an ats_malloc/delete mismatch [trafficserver]
Posted by "bneradt (via GitHub)" <gi...@apache.org>.
bneradt merged PR #11049:
URL: https://github.com/apache/trafficserver/pull/11049
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org