canonical / nrpe_exporter

A Prometheus exporter for generating metrics from commands executed by a running NRPE daemon.
Apache License 2.0
48 stars 18 forks source link

Catch errors in the deferred `conn.Close()` also #34

Closed rbarry82 closed 1 year ago

rbarry82 commented 1 year ago

Issue

The spacemonkey OpenSSL wrapper may also return errors when trying to finalize by closing a connection with a nil pointer dereference. Check immediately after instantiating it and fail early, or we'll get a nilpointerexception on the defer