F-4312: free ALPN peerProtos on peerProtosCopy allocation failure in NativeALPNSelectCb

pull/382/head
Chris Conlon 2026-07-17 13:43:36 -06:00
parent 88af9ff03f
commit 536069f33f
1 changed files with 1 additions and 0 deletions

View File

@ -5543,6 +5543,7 @@ int NativeALPNSelectCb(WOLFSSL *ssl, const unsigned char **out,
peerProtosCopy = (char*)XMALLOC(peerProtosSz + 1, NULL,
DYNAMIC_TYPE_TMP_BUFFER);
if (peerProtosCopy == NULL) {
wolfSSL_ALPN_FreePeerProtocol(ssl, &peerProtos);
if ((*jenv)->ExceptionOccurred(jenv)) {
(*jenv)->ExceptionDescribe(jenv);
(*jenv)->ExceptionClear(jenv);