Commit 741b0f37 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Fix a memory leak (valgrind).

parent 846811be
......@@ -2395,25 +2395,36 @@ HRESULT WINAPI MsiGetFileSignatureInformationW( LPCWSTR path, DWORD flags, PCCER
data.dwProvFlags = 0;
data.dwUIContext = WTD_UICONTEXT_INSTALL;
hr = WinVerifyTrustEx( INVALID_HANDLE_VALUE, &generic_verify_v2, &data );
if (FAILED(hr)) return hr;
if (FAILED(hr)) goto done;
signer = WTHelperGetProvSignerFromChain( data.hWVTStateData, 0, FALSE, 0 );
if (!signer) return TRUST_E_NOSIGNATURE;
if (!(signer = WTHelperGetProvSignerFromChain( data.hWVTStateData, 0, FALSE, 0 )))
{
hr = TRUST_E_NOSIGNATURE;
goto done;
}
if (hash)
{
DWORD len = signer->psSigner->EncryptedHash.cbData;
if (*hashlen < len)
{
*hashlen = len;
return HRESULT_FROM_WIN32(ERROR_MORE_DATA);
hr = HRESULT_FROM_WIN32(ERROR_MORE_DATA);
goto done;
}
memcpy( hash, signer->psSigner->EncryptedHash.pbData, len );
*hashlen = len;
}
provider = WTHelperGetProvCertFromChain( signer, 0 );
if (!provider) return TRUST_E_PROVIDER_UNKNOWN;
if (!(provider = WTHelperGetProvCertFromChain( signer, 0 )))
{
hr = TRUST_E_PROVIDER_UNKNOWN;
goto done;
}
*cert = CertDuplicateCertificateContext( provider->pCert );
return S_OK;
done:
data.dwStateAction = WTD_STATEACTION_CLOSE;
WinVerifyTrustEx( INVALID_HANDLE_VALUE, &generic_verify_v2, &data );
return hr;
}
/******************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment