summaryrefslogtreecommitdiff
path: root/qadevOOo
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-10-14 17:02:45 +0200
committerNoel Grandin <noel@peralex.com>2015-10-15 08:28:00 +0200
commit6f596fe57d2c557c09acc83d26c2ff30c556b53c (patch)
tree15c930308c2f322e9ace10a279f80b34589a078b /qadevOOo
parent7007bc3134fa9446853d99f8b08637874875a2f6 (diff)
cid#1326507 Resource leak
Change-Id: If4bf5978fca921860d44421e17dd4f3d772d1c22
Diffstat (limited to 'qadevOOo')
-rw-r--r--qadevOOo/runner/util/utils.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/qadevOOo/runner/util/utils.java b/qadevOOo/runner/util/utils.java
index 106f757095ee..05b9852c70da 100644
--- a/qadevOOo/runner/util/utils.java
+++ b/qadevOOo/runner/util/utils.java
@@ -571,8 +571,13 @@ public class utils {
continue;
}
try {
- new Socket("localhost", port);
+ Socket sock = new Socket("localhost", port);
System.out.println(" -> socket: occupied port: " + port);
+ try {
+ sock.close();
+ } catch (IOException ex) {
+ // ignore close exception
+ }
} catch (IOException e) {
System.out.println(" -> free port");
return port;