From 19c1a3a3f9e8de200b81a4c36981ca7c569c159a Mon Sep 17 00:00:00 2001 From: Go Hosohara Date: Wed, 11 Jul 2018 15:24:25 +0900 Subject: [PATCH] Fix i2d_RSAPublicKey() memory leak issue. --- src/ssl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ssl.c b/src/ssl.c index 624d6b634..0ea2dfe93 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -28484,6 +28484,9 @@ int wolfSSL_i2d_RSAPublicKey(WOLFSSL_RSA *rsa, const unsigned char **pp) } if((pp != NULL) && (ret >= 0)) *pp = der; + else + XFREE(der, NULL, DYNAMIC_TYPE_TMP_BUFFER); + return ret; } #endif /* #if !defined(HAVE_FAST_RSA) */