From: Alexander Köplinger Date: Tue, 10 Jan 2017 21:14:47 +0000 (+0100) Subject: [btls] Free handle returned by EVP_PKEY_get1_RSA X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=2cadd74de82eafd7bef160ec4c3ad9b7b5ca7127;p=mono.git [btls] Free handle returned by EVP_PKEY_get1_RSA From the header docs: > The |get1| functions return a fresh reference to the underlying > object or NULL if |pkey| is not of the correct type. --- diff --git a/mono/btls/btls-key.c b/mono/btls/btls-key.c index 65909a527d9..80ea9ef29cd 100644 --- a/mono/btls/btls-key.c +++ b/mono/btls/btls-key.c @@ -54,6 +54,8 @@ mono_btls_key_get_bytes (EVP_PKEY *pkey, uint8_t **buffer, int *size, int includ else ret = RSA_public_key_to_bytes (buffer, &len, rsa); + RSA_free (rsa); + if (ret != 1) return 0;