From: Pauli Date: Sun, 13 Sep 2020 21:47:26 +0000 (+1000) Subject: generate_cookie_callback: free temporary memory on an error path X-Git-Tag: openssl-3.0.0-alpha7~236 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=871881856fa1da2c175b17c52f6b0b1c15d791a1;p=thirdparty%2Fopenssl.git generate_cookie_callback: free temporary memory on an error path Reviewed-by: Richard Levitte Reviewed-by: Kurt Roeckx (Merged from https://github.com/openssl/openssl/pull/12870) --- diff --git a/apps/lib/s_cb.c b/apps/lib/s_cb.c index ec52cef1580..72fb98402d4 100644 --- a/apps/lib/s_cb.c +++ b/apps/lib/s_cb.c @@ -786,6 +786,7 @@ int generate_cookie_callback(SSL *ssl, unsigned char *cookie, /* Create buffer with peer's address and port */ if (!BIO_ADDR_rawaddress(peer, NULL, &length)) { BIO_printf(bio_err, "Failed getting peer address\n"); + BIO_ADDR_free(lpeer); return 0; } OPENSSL_assert(length != 0);