From 7f55249334f0dd265a3c2579812cbcec6c946944 Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Mon, 14 Oct 2019 18:00:34 +0300 Subject: [PATCH] Fix potential memory leak Fixes #180 --- gost_grasshopper_cipher.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gost_grasshopper_cipher.c b/gost_grasshopper_cipher.c index ba353c2..9df7bbc 100644 --- a/gost_grasshopper_cipher.c +++ b/gost_grasshopper_cipher.c @@ -713,6 +713,7 @@ int gost_grasshopper_set_asn1_parameters(EVP_CIPHER_CTX *ctx, ASN1_TYPE *params) os = ASN1_OCTET_STRING_new(); if (!os || !ASN1_OCTET_STRING_set(os, buf, len)) { + ASN1_OCTET_STRING_free(os); OPENSSL_free(buf); GOSTerr(GOST_F_GOST_GRASSHOPPER_SET_ASN1_PARAMETERS, ERR_R_MALLOC_FAILURE); -- 2.39.5