diff options
author | Mark Wielaard <mark@klomp.org> | 2013-07-30 23:46:10 +0200 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-07-31 16:20:27 +0000 |
commit | 431d894f3e04a2fa0addc495587d0080b65c0e36 (patch) | |
tree | 3e81daed4c6b5c9893ca655cff38a5f8dea8ba35 /sal | |
parent | a4b4bde0a28b06f150ec80a65e322491a547f803 (diff) |
Fix memory leak in osl_getSystemPathFromFileURL.
rtl_uStrings should never be directly assigned. That might mess up
reference counting. osl_getSystemPathFromFileURL can be called with
pustrSystemPath pointing to a non-empty rtl_uStrings. A special case
being when the ustrFileURL input and the pustrSystemPath output point
to the same rtl_uString instance. So use rtl_uString_assign.
Change-Id: I48e17817cba905a4a6d4bc303d072d62941b0d9c
Reviewed-on: https://gerrit.libreoffice.org/5209
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/file_url.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx index 304f8b4a5b93..6026660635db 100644 --- a/sal/osl/unx/file_url.cxx +++ b/sal/osl/unx/file_url.cxx @@ -283,7 +283,8 @@ oslFileError SAL_CALL osl_getSystemPathFromFileURL( rtl_uString *ustrFileURL, rt OSL_ASSERT( !findWrongUsage( pTmp->buffer, pTmp->length ) ); */ - *pustrSystemPath = pTmp; + rtl_uString_assign ( pustrSystemPath, pTmp ); + rtl_uString_release ( pTmp ); return osl_File_E_None; } |