qmgr/tests: Fix minor potential memory leaks.

This commit is contained in:
Dan Hipschman 2008-04-15 11:08:48 -07:00 committed by Alexandre Julliard
parent a73ab629e9
commit cacd1c448e
2 changed files with 9 additions and 0 deletions

View File

@ -209,6 +209,7 @@ static void test_Next_walkList_2(void)
if(hres != S_OK)
{
skip("Unable to get file from test_enumJobs\n");
HeapFree(GetProcessHeap(), 0, jobs);
return;
}
ok(fetched == test_jobCountB, "Next returned the incorrect number of jobs: %08x\n", hres);
@ -219,6 +220,8 @@ static void test_Next_walkList_2(void)
if (jobs[i])
IBackgroundCopyFile_Release(jobs[i]);
}
HeapFree(GetProcessHeap(), 0, jobs);
}
/* Test Next Error conditions */

View File

@ -416,6 +416,8 @@ static void test_CompleteLocalURL(void)
if (!urlA || !urlB)
{
skip("Unable to allocate memory for URLs\n");
HeapFree(GetProcessHeap(), 0, urlA);
HeapFree(GetProcessHeap(), 0, urlB);
return;
}
@ -428,6 +430,8 @@ static void test_CompleteLocalURL(void)
if (hres != S_OK)
{
skip("Unable to add file to job\n");
HeapFree(GetProcessHeap(), 0, urlA);
HeapFree(GetProcessHeap(), 0, urlB);
return;
}
@ -435,6 +439,8 @@ static void test_CompleteLocalURL(void)
if (hres != S_OK)
{
skip("Unable to add file to job\n");
HeapFree(GetProcessHeap(), 0, urlA);
HeapFree(GetProcessHeap(), 0, urlB);
return;
}