From b573d0ceea8aa85ec6cb1e4609452f5cc405dfc8 Mon Sep 17 00:00:00 2001 From: Pauli Date: Thu, 18 Mar 2021 10:26:22 +1000 Subject: [PATCH] test: fix coverity 1451553: resource leak Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14596) --- test/params_api_test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/params_api_test.c b/test/params_api_test.c index c1dbdad129..e47c2643ad 100644 --- a/test/params_api_test.c +++ b/test/params_api_test.c @@ -540,8 +540,10 @@ static int test_param_construct(void) || !TEST_true(OSSL_PARAM_set_utf8_string(cp, "abcdef")) || !TEST_size_t_eq(cp->return_size, sizeof("abcdef") - 1) || !TEST_true(OSSL_PARAM_get_utf8_string(cp, &bufp, 0)) - || !TEST_str_eq(bufp, "abcdef")) + || !TEST_str_eq(bufp, "abcdef")) { + OPENSSL_free(bufp); goto err; + } OPENSSL_free(bufp); bufp = buf2; if (!TEST_true(OSSL_PARAM_get_utf8_string(cp, &bufp, sizeof(buf2)))