From c8c65530f280decf783eb229ef245b28135bc79b Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 20 Sep 2023 11:10:41 +1000 Subject: [PATCH] close possible handle leak generating .index.db --- .../org/hl7/fhir/utilities/npm/NpmPackageIndexBuilder.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/NpmPackageIndexBuilder.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/NpmPackageIndexBuilder.java index 9b8172192..a65dbb0ef 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/NpmPackageIndexBuilder.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/npm/NpmPackageIndexBuilder.java @@ -61,6 +61,12 @@ public class NpmPackageIndexBuilder { psql = conn.prepareStatement("Insert into ResourceList (FileName, ResourceType, Id, Url, Version, Kind, Type, Supplements, Content, ValueSet) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); } catch (Exception e) { + if (conn != null) { + try { + conn.close(); + } catch (SQLException e1) { + } + } conn = null; } }