Skip to content

Commit 6807db8

Browse files
author
tb
committed
Fix memleaks reported by Ilya Shipitsin
1 parent 9c61872 commit 6807db8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/regress/lib/libcrypto/gost/gost2814789t.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: gost2814789t.c,v 1.6 2021/12/04 08:15:16 tb Exp $ */
1+
/* $OpenBSD: gost2814789t.c,v 1.7 2022/02/08 17:59:39 tb Exp $ */
22
/* vim: set fileencoding=ascii : Charset: ASCII */
33
/* test/gostr2814789t.c */
44
/* ====================================================================
@@ -1404,7 +1404,8 @@ int main(int argc, char *argv[])
14041404
enlf = 0;
14051405
else
14061406
EVP_EncryptFinal_ex(ectx, bTest1, &enlf);
1407-
EVP_CIPHER_CTX_reset(ectx);
1407+
EVP_CIPHER_CTX_free(ectx);
1408+
ectx = NULL;
14081409
break;
14091410
case G89_IMIT:
14101411
if ((mctx = EVP_MD_CTX_new()) == NULL)
@@ -1435,7 +1436,8 @@ int main(int argc, char *argv[])
14351436
}
14361437
siglen = 4;
14371438
OPENSSL_assert(EVP_DigestSignFinal(mctx, bTest, &siglen));
1438-
EVP_MD_CTX_reset(mctx);
1439+
EVP_MD_CTX_free(mctx);
1440+
mctx = NULL;
14391441
EVP_PKEY_free(mac_key);
14401442
enlu = (int)tcs[t].ullLen;
14411443
enlf = 0;

0 commit comments

Comments
 (0)