Skip to content

Commit ed3e395

Browse files
SC-1431 - Added a finally clause for closing the response body in case of an error.
1 parent d9abad0 commit ed3e395

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

api/src/main/java/org/sonarsource/scanner/api/internal/ServerConnection.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ public void downloadFile(String urlPath, Path toFile) throws IOException {
8282
} catch (IOException | RuntimeException e) {
8383
Utils.deleteQuietly(toFile);
8484
throw e;
85+
}finally {
86+
responseBody.close();
8587
}
8688
}
8789

0 commit comments

Comments
 (0)