]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix CID 1465214 Resource leak (in file_load.c)
authorShane Lontis <shane.lontis@oracle.com>
Mon, 6 Jul 2020 04:31:32 +0000 (14:31 +1000)
committerDmitry Belyavskiy <beldmit@gmail.com>
Wed, 8 Jul 2020 08:19:08 +0000 (11:19 +0300)
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/12379)

crypto/store/loader_file.c

index ed74e5583475630002d7ca5be28afc232e7e2ac5..9a2ada335d240ffc6fe73608ed4f104f03234ab1 100644 (file)
@@ -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