winhttp/tests: Only free a certificate context if retrieving it succeeded.
This commit is contained in:
parent
71880e4818
commit
b0f5b96efe
|
@ -787,7 +787,8 @@ static void test_secure_connection(void)
|
||||||
size = sizeof(cert);
|
size = sizeof(cert);
|
||||||
ret = WinHttpQueryOption(req, WINHTTP_OPTION_SERVER_CERT_CONTEXT, &cert, &size );
|
ret = WinHttpQueryOption(req, WINHTTP_OPTION_SERVER_CERT_CONTEXT, &cert, &size );
|
||||||
ok(ret, "failed to retrieve certificate context %u\n", GetLastError());
|
ok(ret, "failed to retrieve certificate context %u\n", GetLastError());
|
||||||
CertFreeCertificateContext(cert);
|
if (ret)
|
||||||
|
CertFreeCertificateContext(cert);
|
||||||
|
|
||||||
size = sizeof(bitness);
|
size = sizeof(bitness);
|
||||||
ret = WinHttpQueryOption(req, WINHTTP_OPTION_SECURITY_KEY_BITNESS, &bitness, &size );
|
ret = WinHttpQueryOption(req, WINHTTP_OPTION_SECURITY_KEY_BITNESS, &bitness, &size );
|
||||||
|
|
Loading…
Reference in New Issue