[icinga-checkins] icinga.org: icinga-core/dev/ido: classic-ui: fixed invalid freeing of last_check in 'scheduling queue' for first time checks #3444

git at icinga.org git at icinga.org
Wed Nov 28 15:58:04 CET 2012


Module: icinga-core
Branch: dev/ido
Commit: 6d117418ff5f77b7da6292fe1ef232d14f8a2021
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=6d117418ff5f77b7da6292fe1ef232d14f8a2021

Author: Ricardo Bartels <ricardo at bitchbrothers.com>
Date:   Wed Nov 21 00:04:27 2012 +0100

classic-ui: fixed invalid freeing of last_check in 'scheduling queue' for first time checks #3444

refs: #3444

memory allocation wasn't done properly. This should fix it.

---

 Changelog     |    1 +
 cgi/extinfo.c |    8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Changelog b/Changelog
index 37c86b9..13332ad 100644
--- a/Changelog
+++ b/Changelog
@@ -31,6 +31,7 @@ FIXES
 * classic ui: fixed sort_icinga_logfiles_by_name() in readlogs.c fails to take NULL pointers into consideration #3398 - CF
 * classic ui: fixed committing acknowledgement cmd negates flags for send_notification and sticky_ack #3329 - RB
 * classic ui: fixed backtrack_archives only getting calculated on a daily log rotation basis #3416 - RB
+* classic ui: fixed invalid freeing of last_check in 'scheduling queue' for first time checks #3444 - RB
 
 
 CHANGES
diff --git a/cgi/extinfo.c b/cgi/extinfo.c
index 624a073..2913049 100644
--- a/cgi/extinfo.c
+++ b/cgi/extinfo.c
@@ -3602,11 +3602,11 @@ void show_scheduling_queue(void) {
 
 			/* last check */
 			get_time_string(&temp_svcstatus->last_check, date_time, (int)sizeof(date_time), SHORT_DATE_TIME);
-			last_check = (temp_svcstatus->last_check == (time_t)0) ? "N/A" : strdup(date_time);
+			last_check = (temp_svcstatus->last_check == (time_t)0) ? strdup("N/A") : strdup(date_time);
 
 			/* next check */
 			get_time_string(&temp_svcstatus->next_check, date_time, (int)sizeof(date_time), SHORT_DATE_TIME);
-			next_check = (temp_svcstatus->next_check == (time_t)0) ? "N/A" : strdup(date_time);
+			next_check = (temp_svcstatus->next_check == (time_t)0) ? strdup("N/A") : strdup(date_time);
 
 			/* type */
 			if (temp_svcstatus->check_options == CHECK_OPTION_NONE)
@@ -3656,11 +3656,11 @@ void show_scheduling_queue(void) {
 
 			/* last check */
 			get_time_string(&temp_hststatus->last_check, date_time, (int)sizeof(date_time), SHORT_DATE_TIME);
-			last_check = (temp_hststatus->last_check == (time_t)0) ? "N/A" : strdup(date_time);
+			last_check = (temp_hststatus->last_check == (time_t)0) ? strdup("N/A") : strdup(date_time);
 
 			/* next check */
 			get_time_string(&temp_hststatus->next_check, date_time, (int)sizeof(date_time), SHORT_DATE_TIME);
-			next_check = (temp_hststatus->next_check == (time_t)0) ? "N/A" : strdup(date_time);
+			next_check = (temp_hststatus->next_check == (time_t)0) ? strdup("N/A") : strdup(date_time);
 
 			/* type */
 			if (temp_hststatus->check_options == CHECK_OPTION_NONE)





More information about the icinga-checkins mailing list