Skip to content

Commit

Permalink
Fix memory leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
huitema committed Mar 27, 2024
1 parent 2460fd3 commit 82bbd45
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions picoquic/packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ int picoquic_screen_initial_packet(
ret = PICOQUIC_ERROR_MEMORY;
}

if (aead_ctx != NULL) {
/* Free the AEAD CTX */
picoquic_aead_free(aead_ctx);
}

if (pn_dec_ctx != NULL) {
/* Free the PN encryption context */
picoquic_cipher_free(pn_dec_ctx);
}

if (ret == 0) {
if (quic->enforce_client_only) {
/* Cannot create a client connection if the context is client only */
Expand Down

0 comments on commit 82bbd45

Please sign in to comment.