Fix leak in resolveAlias (fpicker/aqua)

Change-Id: I9b154337769763139ee5571d4ec8df9cfb6208f9
Reviewed-on: https://gerrit.libreoffice.org/43104
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
This commit is contained in:
Julien Nabet 2017-10-03 22:44:02 +02:00
parent de05a4ff20
commit 7413ee067f

View file

@ -86,7 +86,11 @@ NSString* resolveAlias( NSString* i_pSystemPath )
CFErrorRef rError;
CFDataRef rBookmark = CFURLCreateBookmarkDataFromFile( nullptr, rUrl, &rError );
CFRelease( rUrl );
if( rBookmark != nullptr )
if( rBookmark == nullptr )
{
CFRelease( rError );
}
else
{
Boolean bIsStale;
CFURLRef rResolvedUrl = CFURLCreateByResolvingBookmarkData( kCFAllocatorDefault, rBookmark, kCFBookmarkResolutionWithoutUIMask,