mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 14:36:13 +01:00
gunixmounts: Squash a static analyser false positive
scan-build thinks that there can be a `NULL` pointer dereference of `error` here because it doesn’t understand that the function return value and `GError` are related: when a valid return value is returned, the error is `NULL` and vice-versa. Try and make that clearer to the static analyser by checking whether the error is `NULL`, rather than the return value. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #1767
This commit is contained in:
parent
a1ff120a98
commit
672a33002e
@ -2079,7 +2079,7 @@ mount_monitor_start (void)
|
||||
if (proc_mounts_channel == NULL)
|
||||
proc_mounts_channel = g_io_channel_new_file (mtab_path, "r", &error);
|
||||
|
||||
if (proc_mounts_channel == NULL)
|
||||
if (error != NULL)
|
||||
{
|
||||
g_warning ("Error creating IO channel for %s: %s (%s, %d)", mtab_path,
|
||||
error->message, g_quark_to_string (error->domain), error->code);
|
||||
|
Loading…
Reference in New Issue
Block a user