Commit 9b2af10f authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

kernel32: Free the resource data if a matching resource exists and we choose not…

kernel32: Free the resource data if a matching resource exists and we choose not to overwrite the existing resource.
parent 6b403d1a
......@@ -810,7 +810,7 @@ static BOOL update_add_resource( QUEUEDUPDATES *updates, LPCWSTR Type, LPCWSTR N
if (existing)
{
if (!overwrite_existing)
return TRUE;
return FALSE;
list_remove( &existing->entry );
HeapFree( GetProcessHeap(), 0, existing );
}
......@@ -1076,7 +1076,10 @@ static BOOL enumerate_mapped_resources( QUEUEDUPDATES *updates,
resdata = allocate_resource_data( Lang, data->CodePage, p, data->Size, FALSE );
if (resdata)
update_add_resource( updates, Type, Name, resdata, FALSE );
{
if (!update_add_resource( updates, Type, Name, resdata, FALSE ))
HeapFree( GetProcessHeap(), 0, resdata );
}
}
res_free_str( Name );
}
......
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