Module: check_mk
Branch: master
Commit: fb94a01ba71db493900048ba52d2a1a9bb38d3b6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fb94a01ba71db4…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Nov 5 11:36:24 2012 +0100
livecheck: fixed SIGSEGV on hosts without check_command
---
ChangeLog | 1 +
livestatus/src/livechecking.c | 5 ++++-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c961f62..b260bba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -131,6 +131,7 @@
* FIX: kill process group of called plugin if timeout is reached
-> preventing possible freeze of livecheck
* FIX: correct escaping of character / in nagios checkresult file
+ * FIX: fixed SIGSEGV on hosts without defined check_command
Checks & Agents:
* FIX: Linux mk_logwatch: iregex Parameter was never used
diff --git a/livestatus/src/livechecking.c b/livestatus/src/livechecking.c
index 1acd9e5..6dfecfd 100644
--- a/livestatus/src/livechecking.c
+++ b/livestatus/src/livechecking.c
@@ -228,7 +228,10 @@ int broker_host_livecheck(int event_type __attribute__
((__unused__)), void *dat
grab_host_macros(hst);
char *raw_command;
- get_raw_command_line(hst->check_command_ptr, hst->host_check_command,
&raw_command,0);
+ if (get_raw_command_line(hst->check_command_ptr, hst->host_check_command,
&raw_command,0) == ERROR) {
+ // No need to free raw_command
+ return NEB_OK;
+ }
char *processed_command;
process_macros(raw_command, &processed_command, 0);