diff options
| author | Guido Falsi <mad@madpilot.net> | 2018-09-29 16:15:42 +0200 |
|---|---|---|
| committer | Guido Falsi <mad@madpilot.net> | 2018-09-29 16:22:44 +0200 |
| commit | c76f59bcc0b4c1a14caa7028e034ab44d3e1b4a8 (patch) | |
| tree | 08e14616b45d27d4dd65f9892a56d4012d3bf2ed /lib | |
| parent | 22f13aa2f19e1eb97f1a7feea248b3d25b038d92 (diff) | |
| download | monitoring-plugins-c76f59b.tar.gz | |
Avoid passing NULL to vprintf().
Diffstat (limited to 'lib')
| -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 ){ | |||
| 87 | void | 87 | void |
| 88 | die (int result, const char *fmt, ...) | 88 | die (int result, const char *fmt, ...) |
| 89 | { | 89 | { |
| 90 | va_list ap; | 90 | if(fmt!=NULL) { |
| 91 | va_start (ap, fmt); | 91 | va_list ap; |
| 92 | vprintf (fmt, ap); | 92 | va_start (ap, fmt); |
| 93 | va_end (ap); | 93 | vprintf (fmt, ap); |
| 94 | va_end (ap); | ||
| 95 | } | ||
| 96 | |||
| 94 | if(this_monitoring_plugin!=NULL) { | 97 | if(this_monitoring_plugin!=NULL) { |
| 95 | np_cleanup(); | 98 | np_cleanup(); |
| 96 | } | 99 | } |
