diff options
-rw-r--r-- | lib/utils_base.c | 4 | ||||
-rw-r--r-- | plugins/check_disk.c | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/utils_base.c b/lib/utils_base.c index c0bc4dc5..a36eb680 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c | |||
@@ -120,10 +120,6 @@ _set_thresholds(thresholds **my_thresholds, char *warn_string, char *critical_st | |||
120 | } | 120 | } |
121 | } | 121 | } |
122 | 122 | ||
123 | if (*my_thresholds > 0) { /* Not sure why, but sometimes could be -1 */ | ||
124 | /* printf("Freeing here: %d\n", *my_thresholds); */ | ||
125 | free(*my_thresholds); | ||
126 | } | ||
127 | *my_thresholds = temp_thresholds; | 123 | *my_thresholds = temp_thresholds; |
128 | 124 | ||
129 | return 0; | 125 | return 0; |
diff --git a/plugins/check_disk.c b/plugins/check_disk.c index 363879c6..29aec629 100644 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c | |||
@@ -688,7 +688,7 @@ process_arguments (int argc, char **argv) | |||
688 | printf("ignoring %s matching regex\n", temp_list->name); | 688 | printf("ignoring %s matching regex\n", temp_list->name); |
689 | 689 | ||
690 | temp_list = np_del_parameter(temp_list, previous); | 690 | temp_list = np_del_parameter(temp_list, previous); |
691 | /* pointer to first element needs to be uΓΌdated if first item gets deleted */ | 691 | /* pointer to first element needs to be updated if first item gets deleted */ |
692 | if (previous == NULL) | 692 | if (previous == NULL) |
693 | path_select_list = temp_list; | 693 | path_select_list = temp_list; |
694 | } else { | 694 | } else { |
@@ -828,11 +828,17 @@ print_path (const char *mypath) | |||
828 | void | 828 | void |
829 | set_all_thresholds (struct parameter_list *path) | 829 | set_all_thresholds (struct parameter_list *path) |
830 | { | 830 | { |
831 | if (path->freespace_units != NULL) free(path->freespace_units); | ||
831 | set_thresholds(&path->freespace_units, warn_freespace_units, crit_freespace_units); | 832 | set_thresholds(&path->freespace_units, warn_freespace_units, crit_freespace_units); |
833 | if (path->freespace_percent != NULL) free (path->freespace_percent); | ||
832 | set_thresholds(&path->freespace_percent, warn_freespace_percent, crit_freespace_percent); | 834 | set_thresholds(&path->freespace_percent, warn_freespace_percent, crit_freespace_percent); |
835 | if (path->usedspace_units != NULL) free (path->usedspace_units); | ||
833 | set_thresholds(&path->usedspace_units, warn_usedspace_units, crit_usedspace_units); | 836 | set_thresholds(&path->usedspace_units, warn_usedspace_units, crit_usedspace_units); |
837 | if (path->usedspace_percent != NULL) free (path->usedspace_percent); | ||
834 | set_thresholds(&path->usedspace_percent, warn_usedspace_percent, crit_usedspace_percent); | 838 | set_thresholds(&path->usedspace_percent, warn_usedspace_percent, crit_usedspace_percent); |
839 | if (path->usedinodes_percent != NULL) free (path->usedinodes_percent); | ||
835 | set_thresholds(&path->usedinodes_percent, warn_usedinodes_percent, crit_usedinodes_percent); | 840 | set_thresholds(&path->usedinodes_percent, warn_usedinodes_percent, crit_usedinodes_percent); |
841 | if (path->freeinodes_percent != NULL) free (path->freeinodes_percent); | ||
836 | set_thresholds(&path->freeinodes_percent, warn_freeinodes_percent, crit_freeinodes_percent); | 842 | set_thresholds(&path->freeinodes_percent, warn_freeinodes_percent, crit_freeinodes_percent); |
837 | } | 843 | } |
838 | 844 | ||