changeset 8739:c0cd180308e4 quic

QUIC: fixed memory leak in ngx_hkdf_extract()/ngx_hkdf_expand(). This fixes leak on successful path when built with OpenSSL.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 07 Apr 2021 15:14:41 +0300
parents 47e0009e53a7
children cc3e9c131d79
files src/event/quic/ngx_event_quic_protection.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/event/quic/ngx_event_quic_protection.c
+++ b/src/event/quic/ngx_event_quic_protection.c
@@ -348,6 +348,8 @@ ngx_hkdf_expand(u_char *out_key, size_t 
         goto failed;
     }
 
+    EVP_PKEY_CTX_free(pctx);
+
     return NGX_OK;
 
 failed:
@@ -409,6 +411,8 @@ ngx_hkdf_extract(u_char *out_key, size_t
         goto failed;
     }
 
+    EVP_PKEY_CTX_free(pctx);
+
     return NGX_OK;
 
 failed: