summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2021-03-21 14:06:29 +0000
committertb <>2021-03-21 14:06:29 +0000
commita743462ddbd1c456c9e01a4546f33ad2dff15abd (patch)
treeb8ffea362989d474f348dcd37a93f177b80f430f /src
parent80699e75c203f0ea0eb0874d664a651069961340 (diff)
downloadopenbsd-a743462ddbd1c456c9e01a4546f33ad2dff15abd.tar.gz
openbsd-a743462ddbd1c456c9e01a4546f33ad2dff15abd.tar.bz2
openbsd-a743462ddbd1c456c9e01a4546f33ad2dff15abd.zip
Plug memory leak reported by Ilya Shipitsin
Since r1.7, input in base64_decoding_test() is allocated unconditionally, so free it unconditionally.
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libcrypto/base64/base64test.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/regress/lib/libcrypto/base64/base64test.c b/src/regress/lib/libcrypto/base64/base64test.c
index cfe7922267..a05bc10754 100644
--- a/src/regress/lib/libcrypto/base64/base64test.c
+++ b/src/regress/lib/libcrypto/base64/base64test.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: base64test.c,v 1.8 2020/03/10 11:13:28 inoguchi Exp $ */ 1/* $OpenBSD: base64test.c,v 1.9 2021/03/21 14:06:29 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -434,8 +434,7 @@ base64_decoding_test(int test_no, struct base64_test *bt, int test_nl)
434done: 434done:
435 BIO_free_all(bio_mem); 435 BIO_free_all(bio_mem);
436 free(buf); 436 free(buf);
437 if (test_nl) 437 free(input);
438 free(input);
439 438
440 return failure; 439 return failure;
441} 440}