From eb7a2039256fae474a89d856a5fb29e8efc994a9 Mon Sep 17 00:00:00 2001 From: tb Date: Sun, 21 Mar 2021 14:06:29 +0000 Subject: [PATCH] Plug memory leak reported by Ilya Shipitsin Since r1.7, input in base64_decoding_test() is allocated unconditionally, so free it unconditionally. --- regress/lib/libcrypto/base64/base64test.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/regress/lib/libcrypto/base64/base64test.c b/regress/lib/libcrypto/base64/base64test.c index cfe79222670..a05bc107547 100644 --- a/regress/lib/libcrypto/base64/base64test.c +++ b/regress/lib/libcrypto/base64/base64test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: base64test.c,v 1.8 2020/03/10 11:13:28 inoguchi Exp $ */ +/* $OpenBSD: base64test.c,v 1.9 2021/03/21 14:06:29 tb Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -434,8 +434,7 @@ base64_decoding_test(int test_no, struct base64_test *bt, int test_nl) done: BIO_free_all(bio_mem); free(buf); - if (test_nl) - free(input); + free(input); return failure; } -- 2.20.1