Skip to content

Commit fcbf203

Browse files
committed
Merge pull request #13 from thc202/issue/resource_leak
Fix resource leak in ThingFactory class
2 parents 5ec064e + f5d35e1 commit fcbf203

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/org/owasp/benchmark/helpers/ThingFactory.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ public static ThingInterface createThing() {
2929
Properties props = new Properties();
3030

3131
// create a thing using reflection
32-
try {
33-
InputStream thingproperties = ThingFactory.class.getClassLoader().getResourceAsStream("thing.properties");
32+
try (InputStream thingproperties = ThingFactory.class.getClassLoader().getResourceAsStream("thing.properties")) {
3433
if (thingproperties == null) {
3534
System.out.println("Can't find thing.properties");
3635
return new Thing2();

0 commit comments

Comments
 (0)