From 9608c794c925ddf406d62cd1a3ed02175c2c8098 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <nsivov@codeweavers.com>
Date: Sun, 10 Jan 2016 21:19:35 +0300
Subject: [PATCH] crypt32: Fix a leak on error path (Coverity).

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
 dlls/crypt32/chain.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c
index 056910faaa2..aab2e91583b 100644
--- a/dlls/crypt32/chain.c
+++ b/dlls/crypt32/chain.c
@@ -2293,7 +2293,10 @@ static BOOL CRYPT_BuildCandidateChainFromCert(CertificateChainEngine *engine,
             chain->context.dwRevocationFreshnessTime = 0;
         }
         else
+        {
+            CRYPT_FreeSimpleChain(simpleChain);
             ret = FALSE;
+        }
         *ppChain = chain;
     }
     return ret;
-- 
GitLab