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

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

View File

@ -494,6 +494,13 @@ public class ImportExportOperation extends BaseOperation {
} catch (IOException e) {
log.add(LogType.MSG_EXPORT_ERROR_IO, 1);
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);
}
}