qadevOOo/runner/helper/CfgParser.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
New commits: commit d9a9f7f35e663896995625a44dc80d6c6c37cf9a Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Mar 22 10:39:04 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon Mar 22 14:43:52 2021 +0100 cid#1474333 Resource leak on an exceptional path Change-Id: I84ae0f078fade95f6219b2e949e60fb1d6b60f75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112877 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/qadevOOo/runner/helper/CfgParser.java b/qadevOOo/runner/helper/CfgParser.java index b65697e9b6c8..a93e725fd99b 100644 --- a/qadevOOo/runner/helper/CfgParser.java +++ b/qadevOOo/runner/helper/CfgParser.java @@ -91,9 +91,12 @@ public class CfgParser try { FileInputStream propFile = new FileInputStream(name); - prop.load(propFile); - System.out.println("Parsing properties from " + name); - propFile.close(); + try { + prop.load(propFile); + System.out.println("Parsing properties from " + name); + } finally { + propFile.close(); + } } catch (Exception e) { @@ -105,7 +108,11 @@ public class CfgParser System.out.println("Parsing properties from " + name); java.net.URLConnection connection = url.openConnection(); java.io.InputStream in = connection.getInputStream(); - prop.load(in); + try { + prop.load(in); + } finally { + in.close(); + } } } catch (Exception ex) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits