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) struct parameter_list * np_del_parameter(struct parameter_list *item, struct parameter_list *prev) { - struct parameter_list *next; - if (item->name_next) - next = item->name_next; - else - next = NULL; + struct parameter_list *next; - - free(item); - if (prev) - prev->name_next = next; + if (item->name_next) + next = item->name_next; + else + next = NULL; - return next; + free(item); + if (prev) + prev->name_next = next; + return next; } |