Skip to content

Commit 54baed3

Browse files
fdubwilliamcroberts
authored andcommitted
ssl_util: fix memory leak
os is allocated with d2i_ASN1_OCTET_STRING and must be released with ASN1_OCTET_STRING_free to avoid leaking the internal buffer. Fixes pkcs-keygen.int and pkcs-sign-verify.int tests on opensuse-leap (clang) Signed-off-by: Fabian Dubberke <fdub@posteo.de>
1 parent 9460b04 commit 54baed3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib/ssl_util.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <openssl/bn.h>
66
#include <openssl/crypto.h>
77
#include <openssl/ec.h>
8+
#include <openssl/asn1.h>
89
#include <openssl/err.h>
910
#include <openssl/evp.h>
1011
#include <openssl/rsa.h>
@@ -229,7 +230,7 @@ static CK_RV get_EC_evp_pubkey(CK_ATTRIBUTE_PTR ecparams, CK_ATTRIBUTE_PTR ecpoi
229230
}
230231

231232
out:
232-
OPENSSL_free(os);
233+
ASN1_OCTET_STRING_free(os);
233234
OSSL_PARAM_BLD_free(bld);
234235
OSSL_PARAM_free(params);
235236
EVP_PKEY_CTX_free(evp_ctx);

0 commit comments

Comments
 (0)