Close potential filedescriptor leak.

This commit is contained in:
alron 2011-03-12 01:35:07 -08:00
parent 0007acd05b
commit 77cc1a70c4

View File

@ -87,8 +87,15 @@ public class ClientUpdateHandler implements HttpHandler {
response.fields.put(HttpField.ContentLength, Integer.toString(bytes.length));
response.status = HttpStatus.OK;
BufferedOutputStream out = new BufferedOutputStream(response.getBody());
out.write(bytes);
out.flush();
BufferedOutputStream out = null;
try {
out = new BufferedOutputStream(response.getBody());
out.write(bytes);
out.flush();
}
finally
{
out.close();
}
}
}