File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
core-server/src/main/java/org/glassfish/jersey/server Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2012, 2020 Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved.
33 *
44 * This program and the accompanying materials are made available under the
55 * terms of the Eclipse Public License v. 2.0, which is available at
@@ -460,6 +460,8 @@ private boolean processResponseError(final Throwable responseError) {
460460 final Iterable <ResponseErrorMapper > mappers = Providers .getAllProviders (runtime .injectionManager ,
461461 ResponseErrorMapper .class );
462462
463+ ContainerResponse processedResponse = null ;
464+
463465 try {
464466 Response processedError = null ;
465467 for (final ResponseErrorMapper mapper : mappers ) {
@@ -470,11 +472,16 @@ private boolean processResponseError(final Throwable responseError) {
470472 }
471473
472474 if (processedError != null ) {
473- processResponse (new ContainerResponse (processingContext .request (), processedError ));
475+ processedResponse =
476+ processResponse (new ContainerResponse (processingContext .request (), processedError ));
474477 processed = true ;
475478 }
476479 } catch (final Throwable throwable ) {
477480 LOGGER .log (Level .FINE , LocalizationMessages .ERROR_EXCEPTION_MAPPING_PROCESSED_RESPONSE_ERROR (), throwable );
481+ } finally {
482+ if (processedResponse != null ) {
483+ release (processedResponse );
484+ }
478485 }
479486 }
480487
You can’t perform that action at this time.
0 commit comments