From: Shane Lontis Date: Mon, 6 Jul 2020 04:31:32 +0000 (+1000) Subject: Fix CID 1465214 Resource leak (in file_load.c) X-Git-Tag: openssl-3.0.0-alpha5~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=821278a885c7c8edb5bca943006df5700257390e;p=thirdparty%2Fopenssl.git Fix CID 1465214 Resource leak (in file_load.c) Reviewed-by: Dmitry Belyavskiy (Merged from https://github.com/openssl/openssl/pull/12379) --- diff --git a/crypto/store/loader_file.c b/crypto/store/loader_file.c index ed74e558347..9a2ada335d2 100644 --- a/crypto/store/loader_file.c +++ b/crypto/store/loader_file.c @@ -1545,8 +1545,10 @@ static OSSL_STORE_INFO *file_load(OSSL_STORE_LOADER_CTX *ctx, } while (matchcount == 0 && !file_eof(ctx) && !file_error(ctx)); /* We bail out on ambiguity */ - if (matchcount > 1) + if (matchcount > 1) { + OSSL_STORE_INFO_free(result); return NULL; + } if (result != NULL && ctx->expected_type != 0