mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 11:15:21 +01:00
Close potential filedescriptor leak.
This commit is contained in:
parent
5fa0bb1fa6
commit
0007acd05b
@ -1,6 +1,7 @@
|
||||
package org.dynmap.web.handlers;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
@ -32,8 +33,15 @@ public class ClientConfigurationHandler implements HttpHandler {
|
||||
response.fields.put("Content-Length", Integer.toString(cachedConfiguration.length));
|
||||
response.status = HttpStatus.OK;
|
||||
|
||||
BufferedOutputStream out = new BufferedOutputStream(response.getBody());
|
||||
out.write(cachedConfiguration);
|
||||
out.flush();
|
||||
BufferedOutputStream out = null;
|
||||
try {
|
||||
out = new BufferedOutputStream(response.getBody());
|
||||
out.write(cachedConfiguration);
|
||||
out.flush();
|
||||
}
|
||||
finally
|
||||
{
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user