Kaydet (Commit) 1e83fab9 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1326516 Resource leak on an exceptional path

Change-Id: I91cc5614fb0db76eabd46cbe7e39ae33227728b7
üst b08e200c
......@@ -184,12 +184,16 @@ public final class Driver {
Document convertedFile = (Document)mergeDocEnum.next();
merger.merge(convertedFile);
mergeIS.close();
mergeIS.close();
FileOutputStream fos = new FileOutputStream(mergeFile);
mergeDoc.write(fos);
fos.flush();
fos.close();
FileOutputStream fos = null;
try {
fos = new FileOutputStream(mergeFile);
mergeDoc.write(fos);
fos.flush();
} finally {
close(fos);
}
} catch (Exception mergeExcept) {
System.out.println("\nThere was an error in the merge");
mergeExcept.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment