gunixmounts: Fix segfaults caused by new filter of mounts

Ondrej Holy requested to merge wip/oholy/gunixmounts-segfaults into glib-2-58

Commit ed88b23f added libmount-based implementation to filter out mounts with repeated device path. Unfortunately, this introduced a new bug, which may cause segfaults from in certain configurations.

The problem is that mnt_table_uniq_fs () is called from the loop which already operates with the fs structs from that table. It may happen that the current fs is removed from the table, which may consequently lead to segfaults.

Closes: #1645 (closed)

Edited by Ondrej Holy

Merge request reports