From: Darrick J. Wong Date: Wed, 6 Dec 2017 15:17:08 +0000 (-0600) Subject: libfrog: add missing function fs_table_destroy X-Git-Tag: v4.15.0-rc1~127 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce1abf95b49120035a077107b39f23d15d82fa7b;p=thirdparty%2Fxfsprogs-dev.git 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 --- 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 */