From: Pauli Date: Thu, 18 Mar 2021 00:26:22 +0000 (+1000) Subject: test: fix coverity 1451553: resource leak X-Git-Tag: openssl-3.0.0-alpha14~196 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b573d0ceea8aa85ec6cb1e4609452f5cc405dfc8;p=thirdparty%2Fopenssl.git test: fix coverity 1451553: resource leak Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14596) --- diff --git a/test/params_api_test.c b/test/params_api_test.c index c1dbdad1292..e47c2643ad4 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)))