Code

Add missing --fqdn help (Jan Wagner)
[nagiosplug.git] / lib / utils_base.c
index 77700f5ba7e46079d5abb68c042c0694c79a77eb..4303e1592700bc96cbc752930a157387215f56ad 100644 (file)
@@ -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;