libmount: initialize *root to NULL in mnt_table_get_root_fs
PATCH 1/1 libmount: initialize *root to NULL in mnt_table_get_root_fs
mnt_table_get_root_fs only works when *root is set to NULL. This is not only undocumented, but also unintuitive. Fix it by initializing *root inside mnt_table_get_root_fs.
--- libmount/src/tab.c | 1 + 1 file changed, 1 insertion(+)
libmount/src/tab.c +1 -0
@@ -501,6 +501,7 @@ int mnt_table_get_root_fs(struct libmnt_table *tb, struct libmnt_fs **root)struct libmnt_iter itr;struct libmnt_fs *fs;int root_id =0 ; + *root =NULL ;assert (tb);assert (root);
Signature · 1 line
1.8.5.4
Karel Zak
maintainerQuoted 2 lines · Thomas Bächler
libmount/src/tab.c | 1 + 1 file changed, 1 insertion(+)
Applied with a small change, thanks!
Karel
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com