}
status |= wait_many(FLAG_WAIT_ALL);
free(fsck_path);
- mnt_free_cache(mntcache);
+ mnt_unref_cache(mntcache);
mnt_free_table(fstab);
mnt_free_table(mtab);
return status;
tt_free_table(tt);
mnt_free_table(tb);
- mnt_free_cache(cache);
+ mnt_unref_cache(cache);
free(tabfiles);
#ifdef HAVE_LIBUDEV
udev_unref(udev);
tt_free_table(lsblk->tt);
mnt_free_table(mtab);
mnt_free_table(swaps);
- mnt_free_cache(mntcache);
+ mnt_unref_cache(mntcache);
#ifdef HAVE_LIBUDEV
udev_unref(udev);
#endif
if (!mtab)
err(EXIT_FAILURE, _("failed to initialize libmount table"));
- cache = mnt_new_cache();
+ if (!cache)
+ cache = mnt_new_cache();
mnt_table_set_cache(mtab, cache);
if (p_option)
free(mountpoint);
mnt_free_table(mtab);
- mnt_free_cache(cache);
+ mnt_unref_cache(cache);
return EXIT_SUCCESS;
}
free(xsrc);
}
- mnt_free_cache(cache);
+ mnt_unref_cache(cache);
mnt_free_iter(itr);
}
* make a connection between the fstab and the canonicalization
* cache.
*/
- struct libmnt_cache *cache = mnt_context_get_cache(cxt);
- mnt_table_set_cache(fstab, cache);
+ mnt_table_set_cache(fstab, mnt_context_get_cache(cxt));
}
if (!mnt_context_get_source(cxt) &&
/* to canonicalize all necessary paths */
cache = mnt_new_cache();
mnt_table_set_cache(tb, cache);
+ mnt_unref_cache(cache);
fs = mnt_table_find_target(tb, spec, MNT_ITER_BACKWARD);
if (fs && mnt_fs_get_target(fs)) {
}
mnt_free_table(tb);
- mnt_free_cache(cache);
return rc;
}
status |= swapoff_all();
free_tables();
- mnt_free_cache(mntcache);
+ mnt_unref_cache(mntcache);
return status;
}
status |= do_swapon(*argv++, priority, discard, !CANONIC);
free_tables();
- mnt_free_cache(mntcache);
+ mnt_unref_cache(mntcache);
return status;
}