fix rest of resource leaks (#1351)
This commit is contained in:
1 parent
5895385153
commit
f5aa36ef9f
7 files changed
+79
-65
No files matched your search
+9
-4
@@ -391,10 +391,15 @@ public class KeychainDatabase extends SQLiteOpenHelper {
|
||||
private static void copy(File in, File out) throws IOException {
|
||||
FileInputStream is = new FileInputStream(in);
|
||||
FileOutputStream os = new FileOutputStream(out);
|
||||
byte[] buf = new byte[512];
|
||||
while (is.available() > 0) {
|
||||
int count = is.read(buf, 0, 512);
|
||||
os.write(buf, 0, count);
|
||||
try {
|
||||
byte[] buf = new byte[512];
|
||||
while (is.available() > 0) {
|
||||
int count = is.read(buf, 0, 512);
|
||||
os.write(buf, 0, count);
|
||||
}
|
||||
} finally {
|
||||
is.close();
|
||||
os.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user