Author: toad
Date: 2008-11-27 01:32:36 +0000 (Thu, 27 Nov 2008)
New Revision: 23898

Modified:
   trunk/freenet/src/freenet/client/async/SplitFileFetcher.java
Log:
Fix bucket leak


Modified: trunk/freenet/src/freenet/client/async/SplitFileFetcher.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SplitFileFetcher.java        
2008-11-27 01:32:24 UTC (rev 23897)
+++ trunk/freenet/src/freenet/client/async/SplitFileFetcher.java        
2008-11-27 01:32:36 UTC (rev 23898)
@@ -257,6 +257,7 @@
                        while(!decompressors.isEmpty()) {
                                Compressor c = (Compressor) 
decompressors.removeLast();
                                long maxLen = 
Math.max(fetchContext.maxTempLength, fetchContext.maxOutputLength);
+                               Bucket orig = data;
                                try {
                                        Bucket out = returnBucket;
                                        if(!decompressors.isEmpty()) out = null;
@@ -267,6 +268,8 @@
                                } catch (CompressionOutputSizeException e) {
                                        cb.onFailure(new 
FetchException(FetchException.TOO_BIG, e.estimatedSize, false /* FIXME */, 
clientMetadata.getMIMEType()), this);
                                        return;
+                               } finally {
+                                       if(orig != data) orig.free();
                                }
                        }
                        cb.onSuccess(new FetchResult(clientMetadata, data), 
this);

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to