Skip to content

Commit

Permalink
Fix memory leak of the callChoreo access token request helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
sadilchamishka committed Jan 5, 2025
1 parent 17b92fc commit df73476
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ public void completed(HttpResponse httpResponse) {

boolean isFailure = false;
try {
LOG.debug("Access token response received.");
LOG.info("Access token response received. Session data key: " +
authenticationContext.getContextIdentifier());
int responseCode = httpResponse.getStatusLine().getStatusCode();
if (responseCode == HTTP_STATUS_OK) {
Type responseBodyType = new TypeToken<Map<String, String>>() { }.getType();
Expand Down Expand Up @@ -372,6 +373,8 @@ public void completed(HttpResponse httpResponse) {
LOG.error("Error occurred while handling the token response from Choreo. Session data key: " +
authenticationContext.getContextIdentifier(), e);
isFailure = true;
} finally {
EntityUtils.consumeQuietly(httpResponse.getEntity());
}

if (isFailure) {
Expand Down

0 comments on commit df73476

Please sign in to comment.