Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c874143 authored by Lukas Reschke's avatar Lukas Reschke Committed by David A. Velasco
Browse files

Close resource in finally block

I don't quite get the reason for `mBuf` here as in `com.owncloud.android.lib.common.utils.Log_OC#appendLog` anyways a new `BufferedWriter` is started but it might make sense to close this here as this will otherwise cause warnings in static code scanners.

Didn't test this as I don't have a Java device and so it requires extensive testing.
parent 715a5195
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -100,6 +100,14 @@ public class Log_OC {

        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if(mBuf != null) {
                try {
                    mBuf.close();
                } catch(IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }