From ce1abf95b49120035a077107b39f23d15d82fa7b Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Wed, 6 Dec 2017 09:17:08 -0600 Subject: [PATCH] libfrog: add missing function fs_table_destroy Add a function to tear down the fs_table when we're done messing with paths. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- libfrog/paths.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/libfrog/paths.c b/libfrog/paths.c index b767e9dce..62b4eda6a 100644 --- a/libfrog/paths.c +++ b/libfrog/paths.c @@ -206,6 +206,26 @@ out_nodev: return error; } +/* Remove all the cached entries in the fs table. */ +void +fs_table_destroy(void) +{ + int i; + struct fs_path *fsp; + + for (i = 0, fsp = fs_table; i < fs_count; i++, fsp++) { + free(fsp->fs_name); + free(fsp->fs_dir); + free(fsp->fs_log); + free(fsp->fs_rt); + } + + fs_count = 0; + xfs_fs_count = 0; + free(fs_table); + fs_table = NULL; +} + /* * Table iteration (cursor-based) interfaces */ -- 2.47.2