diff options
author | Sven Nierlein <sven@nierlein.org> | 2018-10-22 16:22:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-22 16:22:54 +0200 |
commit | 82a634f7bfa433b78560be45ae6b52e1d101a26a (patch) | |
tree | a88f5203f1712e080c942e3ea4d4269e3392545b | |
parent | 1c0a48bc6bef8e69566bb4e272649c5a37a67f3a (diff) | |
parent | c76f59bcc0b4c1a14caa7028e034ab44d3e1b4a8 (diff) | |
download | monitoring-plugins-82a634f7bfa433b78560be45ae6b52e1d101a26a.tar.gz |
Merge pull request #1552 from madpilot78/Avoid_passing_NULL_to_vprintf
Avoid passing NULL to vprintf().
-rw-r--r-- | lib/utils_base.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/utils_base.c b/lib/utils_base.c index 3822bcf1..19a531f5 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c @@ -87,10 +87,13 @@ void _get_monitoring_plugin( monitoring_plugin **pointer ){ void die (int result, const char *fmt, ...) { - va_list ap; - va_start (ap, fmt); - vprintf (fmt, ap); - va_end (ap); + if(fmt!=NULL) { + va_list ap; + va_start (ap, fmt); + vprintf (fmt, ap); + va_end (ap); + } + if(this_monitoring_plugin!=NULL) { np_cleanup(); } |