]> www.wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Fix potential memory leak
authorDmitry Belyavskiy <beldmit@gmail.com>
Mon, 14 Oct 2019 15:00:34 +0000 (18:00 +0300)
committerDmitry Belyavskiy <beldmit@gmail.com>
Mon, 14 Oct 2019 15:00:34 +0000 (18:00 +0300)
Fixes #180

gost_grasshopper_cipher.c

index ba353c21850a4791f3a0cd56b7ed4fab76d8bc9d..9df7bbc7b12756d9956cdfb51b7a3351fc56404c 100644 (file)
@@ -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);