From 2d9cf432f683cea56ff3dcb7298098b026eed2d7 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 21 Nov 2014 11:59:55 +0100 Subject: cid#1255386: Unchecked return value Change-Id: Id55f27a3e1a35d1c5ebeccdd9a853f661b5c1746 --- sal/osl/unx/profile.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'sal/osl') diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx index 6c54f6aa02a5..088a2611edb7 100644 --- a/sal/osl/unx/profile.cxx +++ b/sal/osl/unx/profile.cxx @@ -135,11 +135,13 @@ static oslProfile SAL_CALL osl_psz_openProfile(const sal_Char *pszProfileName, o oslProfile SAL_CALL osl_openProfile(rtl_uString *ustrProfileName, oslProfileOption Options) { char profilePath[PATH_MAX] = ""; - - if ( ustrProfileName != 0 && ustrProfileName->buffer[0] != 0 ) - FileURLToPath( profilePath, PATH_MAX, ustrProfileName ); - - return osl_psz_openProfile( profilePath,Options ); + return + (ustrProfileName == nullptr + || ustrProfileName->buffer[0] == 0 + || (FileURLToPath(profilePath, PATH_MAX, ustrProfileName) + == osl_File_E_None)) + ? osl_psz_openProfile(profilePath, Options) + : nullptr; } static oslProfile SAL_CALL osl_psz_openProfile(const sal_Char *pszProfileName, oslProfileOption Flags) -- cgit