Close potential filedescriptor leak.
This commit is contained in:
parent
0007acd05b
commit
77cc1a70c4
1 changed files with 10 additions and 3 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue