diff options
-rw-r--r-- | THANKS.in | 1 | ||||
-rw-r--r-- | lib/utils_base.c | 4 |
2 files changed, 4 insertions, 1 deletions
@@ -254,3 +254,4 @@ Ben Timby Martin Foster Joe Presbrey Will Preston +Nikita Kalabukhov diff --git a/lib/utils_base.c b/lib/utils_base.c index 77700f5b..4303e159 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c @@ -101,7 +101,9 @@ _set_thresholds(thresholds **my_thresholds, char *warn_string, char *critical_st { thresholds *temp_thresholds = NULL; - temp_thresholds = malloc(sizeof(temp_thresholds)); + if ((temp_thresholds = malloc(sizeof(thresholds))) == NULL) + die(STATE_UNKNOWN, _("Cannot allocate memory: %s\n"), + strerror(errno)); temp_thresholds->warning = NULL; temp_thresholds->critical = NULL; |