summaryrefslogtreecommitdiff
path: root/sys-utils/mountpoint.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys-utils/mountpoint.c')
-rw-r--r--sys-utils/mountpoint.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys-utils/mountpoint.c b/sys-utils/mountpoint.c
index c86e94b12..cba5f0125 100644
--- a/sys-utils/mountpoint.c
+++ b/sys-utils/mountpoint.c
@@ -83,6 +83,7 @@ static int dir_to_device(const char *spec, dev_t *dev)
/* 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)) {
@@ -90,8 +91,7 @@ static int dir_to_device(const char *spec, dev_t *dev)
rc = 0;
}
- mnt_free_table(tb);
- mnt_free_cache(cache);
+ mnt_unref_table(tb);
return rc;
}