1
0
mirror of https://github.com/moparisthebest/open-keychain synced 2025-03-03 10:51:49 -05:00

Close stream on key export to avoid partial write (see )

This commit is contained in:
Vincent Breitmoser 2014-10-29 22:39:38 +01:00
parent 727783dd00
commit e1285eec7b

@ -494,6 +494,13 @@ public class ImportExportOperation extends BaseOperation {
} catch (IOException e) { } catch (IOException e) {
log.add(LogType.MSG_EXPORT_ERROR_IO, 1); log.add(LogType.MSG_EXPORT_ERROR_IO, 1);
return new ExportResult(ExportResult.RESULT_ERROR, log, okPublic, okSecret); return new ExportResult(ExportResult.RESULT_ERROR, log, okPublic, okSecret);
} finally {
// Make sure the stream is closed
if (outStream != null) try {
outStream.close();
} catch (Exception e) {
Log.e(Constants.TAG, "error closing stream", e);
}
} }