]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Partially fix #125 (Memory leak in pub_encode_gost_ec)
authorDmitry Belyavskiy <beldmit@gmail.com>
Fri, 22 Mar 2019 19:23:39 +0000 (22:23 +0300)
committerDmitry Belyavskiy <beldmit@gmail.com>
Fri, 22 Mar 2019 19:24:56 +0000 (22:24 +0300)
gost_ameth.c

index 005fbf7257a960113fb82f8a3cdef7a42861a1d8..b13d13201ab8d3ae67a319612cb349f59f100d61 100644 (file)
@@ -757,8 +757,8 @@ static int pub_encode_gost_ec(X509_PUBKEY *pub, const EVP_PKEY *pk)
     }
 
     ret = i2d_ASN1_OCTET_STRING(octet, &buf);
-    ASN1_BIT_STRING_free(octet);
  err:
+    ASN1_BIT_STRING_free(octet);
     if (X)
         BN_free(X);
     if (Y)