[core] Fix another leak

This commit is contained in:
LoveSy 2021-11-08 16:33:34 +08:00 committed by GitHub
parent 2065b84d73
commit 6475dc86a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -125,8 +125,8 @@ public class LogcatService implements Runnable {
var untrusted = "u:r:untrusted_app:s0"; var untrusted = "u:r:untrusted_app:s0";
exec.write(untrusted.getBytes()); exec.write(untrusted.getBytes());
} }
try (var is = new ProcessBuilder(sh, "-c", "getprop").start().getInputStream()) { try (var rd = new BufferedReader(new InputStreamReader(new ProcessBuilder(sh, "-c", "getprop").start().getInputStream()))) {
sb.append(new BufferedReader(new InputStreamReader(is)).readLine()); sb.append(rd.readLine());
} }
} catch (IOException e) { } catch (IOException e) {
Log.e(TAG, "GetProp: " + e + ": " + Arrays.toString(e.getStackTrace())); Log.e(TAG, "GetProp: " + e + ": " + Arrays.toString(e.getStackTrace()));