diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-20 08:52:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-20 09:51:42 +0200 |
commit | 05f67637fc4f71750dda46fccf0bed5b3fd99233 (patch) | |
tree | c5221d056688a87607ffe9e86521a606eb7fa956 /sal/osl/unx/file.cxx | |
parent | 67a0889450daa6b9c9c799dab2d9da3a5044cb5d (diff) |
new cannot return nullptr
unless we are using std::nothrow
Change-Id: I3bdd13c8ce18f4e977f18ee5196311bf4fc62de0
Reviewed-on: https://gerrit.libreoffice.org/38998
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/osl/unx/file.cxx')
-rw-r--r-- | sal/osl/unx/file.cxx | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index 9d7b31d3a7d4..333d2459b351 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -734,8 +734,6 @@ oslFileHandle osl::detail::createFileHandleFromFD( int fd ) return nullptr; // EBADF FileHandle_Impl * pImpl = new FileHandle_Impl (fd); - if (pImpl == nullptr) - return nullptr; // ENOMEM // assume writeable pImpl->m_state |= FileHandle_Impl::STATE_WRITEABLE; @@ -809,11 +807,6 @@ openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandle, const char { oslFileError eRet; FileHandle_Impl * pImpl = new FileHandle_Impl (-1, FileHandle_Impl::KIND_MEM, path); - if (!pImpl) - { - eRet = oslTranslateFileError (OSL_FET_ERROR, ENOMEM); - return eRet; - } pImpl->m_size = sal::static_int_cast< sal_uInt64 >(size); *pHandle = (oslFileHandle)(pImpl); @@ -1015,12 +1008,6 @@ openFilePath( const char *cpFilePath, oslFileHandle* pHandle, sal_uInt32 uFlags, /* allocate memory for impl structure */ FileHandle_Impl * pImpl = new FileHandle_Impl (fd, FileHandle_Impl::KIND_FD, cpFilePath); - if (!pImpl) - { - eRet = oslTranslateFileError (OSL_FET_ERROR, ENOMEM); - (void) close(fd); - return eRet; - } if (flags & O_RDWR) pImpl->m_state |= FileHandle_Impl::STATE_WRITEABLE; pImpl->m_size = sal::static_int_cast< sal_uInt64 >(aFileStat.st_size); |