mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
gunixmounts: Fix crash if path doesn't exist
g_unix_mount_for segfaults for nonexistent paths. Return NULL if path doesn't exist. https://bugzilla.gnome.org/show_bug.cgi?id=772160
This commit is contained in:
parent
1c47f62de7
commit
b626a4677a
@ -1471,8 +1471,11 @@ g_unix_mount_for (const char *file_path,
|
||||
char *topdir;
|
||||
|
||||
topdir = _g_local_file_find_topdir_for (file_path);
|
||||
entry = g_unix_mount_at (topdir, time_read);
|
||||
g_free (topdir);
|
||||
if (topdir != NULL)
|
||||
{
|
||||
entry = g_unix_mount_at (topdir, time_read);
|
||||
g_free (topdir);
|
||||
}
|
||||
}
|
||||
|
||||
return entry;
|
||||
|
Loading…
Reference in New Issue
Block a user