sal/osl/unx/tempfile.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
New commits: commit 668e68d3dfe7f187c51c5ff9af752a8d0369b426 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Aug 2 15:54:12 2018 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Aug 2 22:15:43 2018 +0200 coverity#1438194 silence Resource leak Change-Id: I54cf8e4fc430feb2e34d3f6f0f2abce81973b09a Reviewed-on: https://gerrit.libreoffice.org/58481 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sal/osl/unx/tempfile.cxx b/sal/osl/unx/tempfile.cxx index 2f9fb7182db6..1070dbe0eaa1 100644 --- a/sal/osl/unx/tempfile.cxx +++ b/sal/osl/unx/tempfile.cxx @@ -305,16 +305,18 @@ oslFileError SAL_CALL osl_createTempFile( osl_error = osl_removeFile(temp_file_url); if (osl_error == osl_File_E_None) + { *pHandle = temp_file_handle; - else - osl_closeFile(temp_file_handle); + temp_file_handle = nullptr; + } } else { if (pHandle) + { *pHandle = temp_file_handle; - else - osl_closeFile(temp_file_handle); + temp_file_handle = nullptr; + } rtl_uString_assign(ppustrTempFileURL, temp_file_url); } @@ -322,6 +324,9 @@ oslFileError SAL_CALL osl_createTempFile( rtl_uString_release(temp_file_url); } + if (temp_file_handle) + osl_closeFile(temp_file_handle); + rtl_uString_release(base_directory); return osl_error; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits