Skip to content

Commit 02b8940

Browse files
committed
fix: Did you forget to close a response body?
1 parent 21814f9 commit 02b8940

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/MaintenanceActivity.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,7 @@ public void onConnected(final OkHttpClient okHttpClient)
10071007
@Override
10081008
public void run()
10091009
{
1010+
Response response = null;
10101011
try
10111012
{
10121013
Log.i(TAG, "onConnected:002");
@@ -1016,7 +1017,7 @@ public void run()
10161017
header("User-Agent", GENERIC_TOR_USERAGENT).
10171018
build();
10181019

1019-
Response response = okHttpClient.
1020+
response = okHttpClient.
10201021
newCall(request).
10211022
execute();
10221023
Log.i(TAG, "onConnected:003");
@@ -1176,6 +1177,13 @@ public void run()
11761177
{
11771178
Log.i(TAG, "onConnected:EE2:" + e.getMessage());
11781179
}
1180+
try
1181+
{
1182+
response.body().close();
1183+
}
1184+
catch(Exception e2)
1185+
{
1186+
}
11791187
}
11801188
}.start();
11811189
}

0 commit comments

Comments
 (0)