Commit 321dfcc7 authored by Lei Zhang's avatar Lei Zhang Committed by Alexandre Julliard

gdiplus: Do not access freed memory in a test.

parent 9c9209ac
...@@ -72,20 +72,30 @@ static void check_no_duplicates(node * log) ...@@ -72,20 +72,30 @@ static void check_no_duplicates(node * log)
{ {
INT dups = 0; INT dups = 0;
node * temp = NULL; node * temp = NULL;
node * temp2 = NULL;
node * orig = log;
if(!log) if(!log)
goto end; goto end;
do{ do{
HeapFree(GetProcessHeap(), 0, temp);
temp = log; temp = log;
while((temp = temp->next)) while((temp = temp->next)){
if(log->data == temp->data) if(log->data == temp->data){
dups++; dups++;
break;
}
if(dups > 0)
break;
}
}while((log = log->next)); }while((log = log->next));
temp = orig;
do{
temp2 = temp->next;
HeapFree(GetProcessHeap(), 0, temp); HeapFree(GetProcessHeap(), 0, temp);
temp = temp2;
}while(temp);
end: end:
expect(0, dups); expect(0, dups);
......
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