From 53058522125ef86a65c241ad0a5f56df01d55d6a Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Wed, 19 Nov 2008 05:59:22 +0000 Subject: 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 --- lib/utils_disk.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'lib') 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; } -- cgit v1.2.3-74-g34f1