winhttp/tests: Only free a certificate context if retrieving it succeeded.

This commit is contained in:
Juan Lang 2009-12-08 13:43:49 -08:00 committed by Alexandre Julliard
parent 71880e4818
commit b0f5b96efe
1 changed files with 2 additions and 1 deletions

View File

@ -787,7 +787,8 @@ static void test_secure_connection(void)
size = sizeof(cert);
ret = WinHttpQueryOption(req, WINHTTP_OPTION_SERVER_CERT_CONTEXT, &cert, &size );
ok(ret, "failed to retrieve certificate context %u\n", GetLastError());
CertFreeCertificateContext(cert);
if (ret)
CertFreeCertificateContext(cert);
size = sizeof(bitness);
ret = WinHttpQueryOption(req, WINHTTP_OPTION_SECURITY_KEY_BITNESS, &bitness, &size );