From 8003c1333f686e953aa840c250e31d5c0e6e847f Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sat, 2 Apr 2016 17:00:34 +0200 Subject: [PATCH] GenericJMX: fix potential dereference after NPE Fixes CID #41723 --- bindings/java/org/collectd/java/GenericJMXConfConnection.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bindings/java/org/collectd/java/GenericJMXConfConnection.java b/bindings/java/org/collectd/java/GenericJMXConfConnection.java index aced54b4..887c2895 100644 --- a/bindings/java/org/collectd/java/GenericJMXConfConnection.java +++ b/bindings/java/org/collectd/java/GenericJMXConfConnection.java @@ -137,7 +137,9 @@ class GenericJMXConfConnection { try { - this._jmx_connector.close(); + if (this._jmx_connector != null) { + this._jmx_connector.close(); + } } catch (Exception e) { -- 2.11.0