secur32/tests: Fix a couple of memory leaks.

Found by Valgrind.
This commit is contained in:
Hans Leidekker 2009-12-19 22:29:52 +01:00 committed by Alexandre Julliard
parent b3511ebb70
commit 44f9595454

View File

@ -775,6 +775,8 @@ static void testInitializeSecurityContextFlags(void)
tISCFend: tISCFend:
cleanupBuffers(&client); cleanupBuffers(&client);
pFreeCredentialsHandle(client.cred); pFreeCredentialsHandle(client.cred);
HeapFree(GetProcessHeap(), 0, client.cred);
HeapFree(GetProcessHeap(), 0, client.ctxt);
} }
@ -911,6 +913,11 @@ tAuthend:
sec_status = pFreeCredentialsHandle(client.cred); sec_status = pFreeCredentialsHandle(client.cred);
ok(sec_status == SEC_E_OK, "FreeCredentialsHandle(client) returned %s\n", ok(sec_status == SEC_E_OK, "FreeCredentialsHandle(client) returned %s\n",
getSecError(sec_status)); getSecError(sec_status));
HeapFree(GetProcessHeap(), 0, client.cred);
HeapFree(GetProcessHeap(), 0, client.ctxt);
HeapFree(GetProcessHeap(), 0, server.cred);
HeapFree(GetProcessHeap(), 0, server.ctxt);
} }
static void testSignSeal(void) static void testSignSeal(void)
@ -1186,6 +1193,8 @@ end:
HeapFree(GetProcessHeap(), 0, data[1].pvBuffer); HeapFree(GetProcessHeap(), 0, data[1].pvBuffer);
HeapFree(GetProcessHeap(), 0, complex_data[1].pvBuffer); HeapFree(GetProcessHeap(), 0, complex_data[1].pvBuffer);
HeapFree(GetProcessHeap(), 0, complex_data[3].pvBuffer); HeapFree(GetProcessHeap(), 0, complex_data[3].pvBuffer);
HeapFree(GetProcessHeap(), 0, server.cred);
HeapFree(GetProcessHeap(), 0, server.ctxt);
} }
static void testAcquireCredentialsHandle(void) static void testAcquireCredentialsHandle(void)
@ -1317,6 +1326,8 @@ static void test_cred_multiple_use(void)
ok(ret == SEC_E_OK, "DeleteSecurityContext failed with error 0x%x\n", ret); ok(ret == SEC_E_OK, "DeleteSecurityContext failed with error 0x%x\n", ret);
ret = pFreeCredentialsHandle(&cred); ret = pFreeCredentialsHandle(&cred);
ok(ret == SEC_E_OK, "FreeCredentialsHandle failed with error 0x%x\n", ret); ok(ret == SEC_E_OK, "FreeCredentialsHandle failed with error 0x%x\n", ret);
HeapFree(GetProcessHeap(), 0, buffers[0].pvBuffer);
} }
static void test_null_auth_data(void) static void test_null_auth_data(void)
@ -1358,6 +1369,8 @@ static void test_null_auth_data(void)
ISC_REQ_CONNECTION, 0, SECURITY_NETWORK_DREP, ISC_REQ_CONNECTION, 0, SECURITY_NETWORK_DREP,
NULL, 0, &ctx, &buffer_desc, &attr, &ttl); NULL, 0, &ctx, &buffer_desc, &attr, &ttl);
ok(status == SEC_I_CONTINUE_NEEDED, "InitializeSecurityContextA failed %s\n", getSecError(status)); ok(status == SEC_I_CONTINUE_NEEDED, "InitializeSecurityContextA failed %s\n", getSecError(status));
HeapFree(GetProcessHeap(), 0, buffers[0].pvBuffer);
} }
START_TEST(ntlm) START_TEST(ntlm)