Commit b626a467 authored by Ondrej Holy's avatar Ondrej Holy Committed by Colin Walters

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
parent 1c47f62d
......@@ -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;
......
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