Commit b28c76b0 authored by Mario Sanchez Prada's avatar Mario Sanchez Prada

gunixmounts: Do not leak libmount tables in _g_get_unix_mounts()

Use mnt_context_get_mtab instead of using mnt_context_get_table(), since
that's the recommended way of accessing mtab/mountinfo information, and
also because that way the (struct libmnt_table *) will get automatically
deallocated when calling mnt_free_context()
parent 7cf037ec
......@@ -391,11 +391,7 @@ _g_get_unix_mounts (void)
GList *return_list = NULL;
ctxt = mnt_new_context ();
mnt_context_get_table (ctxt, PROC_MOUNTINFO_PATH, &table);
if (!table)
mnt_context_get_mtab (ctxt, &table);
/* Not much to do if neither mountinfo nor mtab are available */
mnt_context_get_mtab (ctxt, &table);
if (!table)
return NULL;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment