From 235e93be5e83de3b7366b63f4c4244cd310d6f34 Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Thu, 18 Apr 2019 21:06:56 +0200 Subject: [PATCH] More unclosed stuff found by lgtm.com --- src/org/kde/kdeconnect/Helpers/NetworkHelper.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/org/kde/kdeconnect/Helpers/NetworkHelper.java b/src/org/kde/kdeconnect/Helpers/NetworkHelper.java index f14bd791..b6fc16e8 100644 --- a/src/org/kde/kdeconnect/Helpers/NetworkHelper.java +++ b/src/org/kde/kdeconnect/Helpers/NetworkHelper.java @@ -36,9 +36,8 @@ public class NetworkHelper { return false; //We are connected to at least one non-mobile network } if (mobile) { //We suspect we are on a mobile net - try { + try (LineNumberReader is = new LineNumberReader(new FileReader("/proc/net/arp"))) { //Check the number of network neighbours, on data it should be 0 - LineNumberReader is = new LineNumberReader(new FileReader("/proc/net/arp")); is.skip(Long.MAX_VALUE); //Log.e("NetworkHelper", "procnetarp has " + is.getLineNumber() + " lines"); if (is.getLineNumber() > 1) { //The first line are the headers