mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 15:48:54 +02: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:
committed by
Colin Walters
parent
1c47f62de7
commit
b626a4677a
@@ -1471,8 +1471,11 @@ g_unix_mount_for (const char *file_path,
|
|||||||
char *topdir;
|
char *topdir;
|
||||||
|
|
||||||
topdir = _g_local_file_find_topdir_for (file_path);
|
topdir = _g_local_file_find_topdir_for (file_path);
|
||||||
entry = g_unix_mount_at (topdir, time_read);
|
if (topdir != NULL)
|
||||||
g_free (topdir);
|
{
|
||||||
|
entry = g_unix_mount_at (topdir, time_read);
|
||||||
|
g_free (topdir);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return entry;
|
return entry;
|
||||||
|
Reference in New Issue
Block a user