[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - common/FileUtil.cpp

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 30 22:05:34 UTC 2020


 common/FileUtil.cpp |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit cbe71ca126240311dd5871c4885df9b34ed198f9
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Tue Jun 30 16:40:53 2020 +0100
Commit:     Aron Budea <aron.budea at collabora.com>
CommitDate: Wed Jul 1 00:05:15 2020 +0200

    Close files after copying, to avoid fd leak during convert-to.
    
    Change-Id: I24a9726bfea7805aff61d778e9f8f91c5b1ffd52
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97501
    Tested-by: Aron Budea <aron.budea at collabora.com>
    Reviewed-by: Aron Budea <aron.budea at collabora.com>

diff --git a/common/FileUtil.cpp b/common/FileUtil.cpp
index 793fc1e25..4d8ac0a56 100644
--- a/common/FileUtil.cpp
+++ b/common/FileUtil.cpp
@@ -145,6 +145,8 @@ namespace FileUtil
                 LOG_WRN("Unusual: file " << anonymizeUrl(fromPath) << " changed size "
                         "during copy from " << st.st_size << " to " << bytesIn);
             }
+            close(from);
+            close(to);
         }
         catch (...)
         {


More information about the Libreoffice-commits mailing list