Code

GenericJMX: fix potential dereference after NPE
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 2 Apr 2016 15:00:34 +0000 (17:00 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 2 Apr 2016 16:05:14 +0000 (18:05 +0200)
Fixes CID #41723

bindings/java/org/collectd/java/GenericJMXConfConnection.java

index aced54b4f2278955fc69ecb506c0036892027195..887c289562ac09ed17a3aac76efcea88394b1393 100644 (file)
@@ -137,7 +137,9 @@ class GenericJMXConfConnection
   {
     try
     {
-      this._jmx_connector.close();
+      if (this._jmx_connector != null) {
+        this._jmx_connector.close();
+      }
     }
     catch (Exception e)
     {