diff options
author | Matthias Huetsch [mhu] <matthias.huetsch@oracle.com> | 2010-11-25 14:17:30 +0100 |
---|---|---|
committer | Matthias Huetsch [mhu] <matthias.huetsch@oracle.com> | 2010-11-25 14:17:30 +0100 |
commit | 042118c8cbc8e33fbff7e479f974d7571c413859 (patch) | |
tree | 558ebbdba4187ce2445fc296b34a0d56706acbac /sal/osl/unx/file.cxx | |
parent | b82d9a8e18e8fada6a3d44ed4fa776bbf390654b (diff) |
#i115784# sal: fix memory errors uncovered by valgrind and other tools.
Diffstat (limited to 'sal/osl/unx/file.cxx')
-rw-r--r-- | sal/osl/unx/file.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index cc0c041bc328..67f1d05660a8 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -215,7 +215,8 @@ FileHandle_Impl::Allocator::~Allocator() void FileHandle_Impl::Allocator::allocate (sal_uInt8 ** ppBuffer, size_t * pnSize) { OSL_PRECOND((0 != ppBuffer) && (0 != pnSize), "FileHandle_Impl::Allocator::allocate(): contract violation"); - *ppBuffer = static_cast< sal_uInt8* >(rtl_cache_alloc(m_cache)), *pnSize = m_bufsiz; + if ((0 != ppBuffer) && (0 != pnSize)) + *ppBuffer = static_cast< sal_uInt8* >(rtl_cache_alloc(m_cache)), *pnSize = m_bufsiz; } void FileHandle_Impl::Allocator::deallocate (sal_uInt8 * pBuffer) { |