maskit commented on code in PR #12680:
URL: https://github.com/apache/trafficserver/pull/12680#discussion_r2547656897
##########
src/iocore/net/ProxyProtocol.cc:
##########
@@ -552,14 +552,9 @@ ProxyProtocol::set_additional_data(std::string_view data)
{
uint16_t len = data.length();
Dbg(dbg_ctl_proxyprotocol_v2, "Parsing %d byte additional data", len);
- additional_data = static_cast<char *>(ats_malloc(len));
- if (additional_data == nullptr) {
- Dbg(dbg_ctl_proxyprotocol_v2, "Memory allocation failed");
- return -1;
- }
- data.copy(additional_data, len);
+ additional_data.assign(data);
Review Comment:
Don't we need to pass `len`?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]