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 | 596a85aa55fa0cc3f7439ff9a9404869b277487a (patch) | |
tree | 48e5b8a0a12279d4b96e53bdf94da9292e5165a5 /sal/osl/unx/file.cxx | |
parent | eb53ac783eaffed1e35fd5882456b8924c5e181c (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 7f0ef6d62..4ecc7ef53 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) { |