]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - libmount/src/tab_parse.c
libmount: add reference counting to libmount_fs
[thirdparty/util-linux.git] / libmount / src / tab_parse.c
index 24e84457e58b9b9e0927d4141be508b581e3a8c6..e31dac8c2d4b437c99219fe9b6a410b65998b8c2 100644 (file)
@@ -630,8 +630,9 @@ int mnt_table_parse_stream(struct libmnt_table *tb, FILE *f, const char *filenam
                        if (rc == 0 && tb->fmt == MNT_FMT_MOUNTINFO)
                                rc = kernel_fs_postparse(tb, fs, &tid, filename);
                }
+               mnt_unref_fs(fs);
+
                if (rc) {
-                       mnt_free_fs(fs);
                        if (rc == 1)
                                continue;       /* recoverable error */
                        if (feof(f))