Looks good for me.

Vincenzo

Noel J. Bergman wrote:

Stefano Bagnara wrote:

Noel J. Bergman wrote:
OK, I believe that I've identified a much simpler fix for this defect
than
what I've committed so far.
Please let us see the simpler solution.
I have as suggestion of how it should be fixed, so I will elaborate it
only if it differs from what you're trying now.

See below.

        --- Noel

Index: src/java/org/apache/james/core/MimeMessageInputStreamSource.java
===================================================================
--- src/java/org/apache/james/core/MimeMessageInputStreamSource.java
(revision 428253)
+++ src/java/org/apache/james/core/MimeMessageInputStreamSource.java
(working copy)
@@ -81,6 +81,22 @@

            sourceId = file.getCanonicalPath();
        } catch (IOException ioe) {
+            // We had an IOException preparing the temporary file, so
+            // don't just leave it around to garbage collect later.
+            // It isn't as if we are going to use it after we throw
+            // the MessagingException.
+            if (fout != null) try {
+                fout.close();
+                fout = null;
+            } catch (IOException _) {
+                // Ignored - logging unavailable to log this error.
+            }
+
+            if (file != null) {
+                file.delete();
+                file = null;
+            }
+
            throw new MessagingException("Unable to retrieve the data: " +
ioe.getMessage(), ioe);
        } finally {
            try {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to