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 | |||
254 | Martin Foster | 254 | Martin Foster |
255 | Joe Presbrey | 255 | Joe Presbrey |
256 | Will Preston | 256 | Will Preston |
257 | 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 | |||
101 | { | 101 | { |
102 | thresholds *temp_thresholds = NULL; | 102 | thresholds *temp_thresholds = NULL; |
103 | 103 | ||
104 | temp_thresholds = malloc(sizeof(temp_thresholds)); | 104 | if ((temp_thresholds = malloc(sizeof(thresholds))) == NULL) |
105 | die(STATE_UNKNOWN, _("Cannot allocate memory: %s\n"), | ||
106 | strerror(errno)); | ||
105 | 107 | ||
106 | temp_thresholds->warning = NULL; | 108 | temp_thresholds->warning = NULL; |
107 | temp_thresholds->critical = NULL; | 109 | temp_thresholds->critical = NULL; |