diff options
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-11-19 05:59:22 +0000 |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-11-19 05:59:22 +0000 |
commit | 53058522125ef86a65c241ad0a5f56df01d55d6a (patch) | |
tree | f9a2b4a51626b5660bf867c5ffd9388bd3e90638 /lib/utils_disk.c | |
parent | e77ddaf6db1621001634fb5602ea42a59cf0660c (diff) | |
download | monitoring-plugins-53058522125ef86a65c241ad0a5f56df01d55d6a.tar.gz |
check_disk: rerpopulate the mount list after doing a stat() on paths specified with -p for better automount support.
NB: There's a memory leak here - properly freeing the mount list would invlove
much more work - there's many other places where leaks can happen so it
should be a project on its own.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2085 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'lib/utils_disk.c')
-rw-r--r-- | lib/utils_disk.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/utils_disk.c b/lib/utils_disk.c index e22d6680..3ce4d47d 100644 --- a/lib/utils_disk.c +++ b/lib/utils_disk.c | |||
@@ -77,19 +77,18 @@ np_add_parameter(struct parameter_list **list, const char *name) | |||
77 | struct parameter_list * | 77 | struct parameter_list * |
78 | np_del_parameter(struct parameter_list *item, struct parameter_list *prev) | 78 | np_del_parameter(struct parameter_list *item, struct parameter_list *prev) |
79 | { | 79 | { |
80 | struct parameter_list *next; | 80 | struct parameter_list *next; |
81 | if (item->name_next) | ||
82 | next = item->name_next; | ||
83 | else | ||
84 | next = NULL; | ||
85 | 81 | ||
86 | 82 | if (item->name_next) | |
87 | free(item); | 83 | next = item->name_next; |
88 | if (prev) | 84 | else |
89 | prev->name_next = next; | 85 | next = NULL; |
90 | 86 | ||
91 | return next; | 87 | free(item); |
88 | if (prev) | ||
89 | prev->name_next = next; | ||
92 | 90 | ||
91 | return next; | ||
93 | } | 92 | } |
94 | 93 | ||
95 | 94 | ||