Skip to content

Commit

Permalink
Use correct delete[] operator for saved ALPN data. (#1180)
Browse files Browse the repository at this point in the history
Causes runtime aborts when using tcmalloc and is UB
everywhere else.

Could probably tidy this further (e.g. use ScopedBytesRO
when saving the ALPN data), but not today.
  • Loading branch information
prbprbprb authored Nov 3, 2023
1 parent 0ecfb8e commit 6ec6e25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/src/jni/main/include/conscrypt/app_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class AppData {

void clearApplicationProtocols() {
if (applicationProtocolsData != nullptr) {
delete applicationProtocolsData;
delete[] applicationProtocolsData;
applicationProtocolsData = nullptr;
applicationProtocolsLength = static_cast<size_t>(-1);
}
Expand Down

0 comments on commit 6ec6e25

Please sign in to comment.