moonchen opened a new pull request, #13464:
URL: https://github.com/apache/trafficserver/pull/13464

   `SSL_CTX_use_PrivateKey()` takes its own reference on the key, so the 
reference from `PEM_read_bio_PrivateKey()` belongs to the caller. 
`SSLPrivateKeyHandler()` released it only when attaching the key failed, so a 
successful load leaked one `EVP_PKEY` per certificate. This repeats at startup, 
on every config reload, and on every secret or certificate update.
   
   Hold the key in a `scoped_PKEY` so every exit releases it.
   
   Measured over 50 certificate loads through `load_certs()`: 228,240 bytes 
leaked before the change, none after.


-- 
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]

Reply via email to