diff options
author | Mikhail Voytenko <mav@openoffice.org> | 2010-02-02 14:04:59 +0100 |
---|---|---|
committer | Mikhail Voytenko <mav@openoffice.org> | 2010-02-02 14:04:59 +0100 |
commit | 447eb546507b45060107b3ea63803e1b6b0a7f38 (patch) | |
tree | 3348e06dd7ebf919fb7ae31beb3a32071af090ba /sal | |
parent | da599549cc4ac52d298ba10bd481ea279b587a89 (diff) |
#i50885# avoid memory problems
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/w32/file_url.cxx | 2 | ||||
-rw-r--r-- | sal/osl/w32/path_helper.hxx | 7 | ||||
-rw-r--r-- | sal/osl/w32/system.h | 8 |
3 files changed, 13 insertions, 4 deletions
diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx index 2cd1dfa1b5a1..34bcd8169fb3 100644 --- a/sal/osl/w32/file_url.cxx +++ b/sal/osl/w32/file_url.cxx @@ -542,8 +542,6 @@ static DWORD GetCaseCorrectPathNameEx( _tcsupr( lpszPath ); } - rtl_freeMemory( szFile ); - return _tcslen( lpszPath ); } diff --git a/sal/osl/w32/path_helper.hxx b/sal/osl/w32/path_helper.hxx index bc2edafbf7d5..145fab8e7435 100644 --- a/sal/osl/w32/path_helper.hxx +++ b/sal/osl/w32/path_helper.hxx @@ -91,11 +91,14 @@ public: LongPathBuffer( sal_uInt32 nCharNum ) : m_pBuffer( reinterpret_cast<T*>( rtl_allocateMemory( nCharNum * sizeof( T ) ) ) ) , m_nCharNum( nCharNum ) - {} + { + OSL_ENSURE( m_pBuffer, "Can not allocate the buffer!" ); + } ~LongPathBuffer() { - rtl_freeMemory( m_pBuffer ); + if ( m_pBuffer ) + rtl_freeMemory( m_pBuffer ); m_pBuffer = 0; } diff --git a/sal/osl/w32/system.h b/sal/osl/w32/system.h index 33cc44c561a4..8c40fbc78f84 100644 --- a/sal/osl/w32/system.h +++ b/sal/osl/w32/system.h @@ -108,14 +108,22 @@ #endif // #ifdef GCC #ifdef _DLL_ + #ifdef __cplusplus extern "C" DWORD g_dwPlatformId; #else extern DWORD g_dwPlatformId; #endif // #ifdef __cplusplus + #define IS_NT (g_dwPlatformId == VER_PLATFORM_WIN32_NT) #else + +#ifdef __cplusplus + extern "C" DWORD GetPlatformId(void); +#else extern DWORD GetPlatformId(void); +#endif // #ifdef __cplusplus + #define IS_NT (GetPlatformId() == VER_PLATFORM_WIN32_NT) #endif // #ifdef _DLL_ |