summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-11-21 11:59:55 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-11-21 12:00:56 +0100
commit2d9cf432f683cea56ff3dcb7298098b026eed2d7 (patch)
treed0339eb23d9e8d3733889169d7e9893a43f5d1df /sal
parent43f98495b5d0756fc37eef99efba45e388101a1a (diff)
cid#1255386: Unchecked return value
Change-Id: Id55f27a3e1a35d1c5ebeccdd9a853f661b5c1746
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/profile.cxx12
1 files changed, 7 insertions, 5 deletions
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)