Close potential filedescriptor leak.
This commit is contained in:
parent
bc9a0d54d0
commit
d0e2096104
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.fields.put(HttpField.ContentLength, Integer.toString(bytes.length));
|
||||||
response.status = HttpStatus.OK;
|
response.status = HttpStatus.OK;
|
||||||
|
|
||||||
BufferedOutputStream out = new BufferedOutputStream(response.getBody());
|
BufferedOutputStream out = null;
|
||||||
out.write(bytes);
|
try {
|
||||||
out.flush();
|
out = new BufferedOutputStream(response.getBody());
|
||||||
|
out.write(bytes);
|
||||||
|
out.flush();
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
out.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue