mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-25 19:52:10 +01:00
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() https://bugzilla.gnome.org/show_bug.cgi?id=769238
This commit is contained in:
parent
7cf037ec16
commit
b28c76b0d8
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user