8026301: DomainKeyStore doesn't cleanup correctly when storing to keystore

Reviewed-by: mullan
This commit is contained in:
Vinnie Ryan 2013-10-11 20:35:00 +01:00
parent 0a60664cf1
commit 848f690d01

@ -652,9 +652,12 @@ abstract class DomainKeyStore extends KeyStoreSpi {
// Store the keystores
KeyStore keystore = keystores.get(builder.name);
keystore.store(new FileOutputStream(builder.file),
password);
try (FileOutputStream stream =
new FileOutputStream(builder.file)) {
keystore.store(stream, password);
}
} catch (KeyStoreException e) {
throw new IOException(e);
}