mscms: Free memory and handle on error path (Coverity).

This commit is contained in:
Nikolay Sivov 2013-03-31 12:25:12 +04:00 committed by Alexandre Julliard
parent 6ee869da6d
commit 3f3404d248
1 changed files with 5 additions and 1 deletions

View File

@ -1528,14 +1528,18 @@ HPROFILE WINAPI OpenColorProfileW( PPROFILE profile, DWORD access, DWORD sharing
if (cmsprofile)
{
struct profile profile;
HPROFILE hprof;
profile.file = handle;
profile.access = access;
profile.iccprofile = iccprofile;
profile.cmsprofile = cmsprofile;
return create_profile( &profile );
if ((hprof = create_profile( &profile ))) return hprof;
HeapFree( GetProcessHeap(), 0, iccprofile );
cmsCloseProfile( cmsprofile );
}
CloseHandle( handle );
#endif /* HAVE_LCMS */
return NULL;