From 59221f5fe7f9108784d8ac04c863d3f0f53b8fea Mon Sep 17 00:00:00 2001 From: markt Date: Tue, 15 Jul 2008 15:51:44 +0000 Subject: [PATCH] As Remy pointed out, this really should be in the finally block. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@676944 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/catalina/servlets/CGIServlet.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/java/org/apache/catalina/servlets/CGIServlet.java b/java/org/apache/catalina/servlets/CGIServlet.java index 1de39acd1..054cc34f3 100644 --- a/java/org/apache/catalina/servlets/CGIServlet.java +++ b/java/org/apache/catalina/servlets/CGIServlet.java @@ -1728,16 +1728,20 @@ public final class CGIServlet extends HttpServlet { } } //replacement for Process.waitFor() - // Close the output stream if used - if (cgiOutput != null) { - cgiOutput.close(); - } } catch (IOException e){ log ("Caught exception " + e); throw e; } finally{ + // Close the output stream if used + if (cgiOutput != null) { + try { + cgiOutput.close(); + } catch (IOException ioe) { + log ("Exception closing output stream " + ioe); + } + } if (debug > 4) { log ("Running finally block"); } -- 2.11.0