Nikolay Sivov : mscms: Free memory and handle on error path (Coverity).
Module: wine Branch: master Commit: 3f3404d2487129db7da6ec5372b7158304292f5e URL: http://source.winehq.org/git/wine.git/?a=commit;h=3f3404d2487129db7da6ec5372... Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Mar 31 12:25:12 2013 +0400 mscms: Free memory and handle on error path (Coverity). --- dlls/mscms/profile.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/dlls/mscms/profile.c b/dlls/mscms/profile.c index b0ffce4..8444e14 100644 --- a/dlls/mscms/profile.c +++ b/dlls/mscms/profile.c @@ -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;
participants (1)
-
Alexandre Julliard