summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorDebarshi Ray <debarshir@gnome.org>2014-10-23 16:10:20 +0200
committerDebarshi Ray <debarshir@gnome.org>2014-10-24 07:18:16 +0200
commitb7871c6ea836f8f357dfe78cabb9f90f08385660 (patch)
treeba13e202ce998df47e03f4eba6869a99e099dc8b /client
parent1ffad3a0eaf37381b57e65c09c66ef00ecc90505 (diff)
downloadgvfs-b7871c6ea836f8f357dfe78cabb9f90f08385660.tar.gz
client: Don't guard against g_object_new returning NULL
The call to g_daemon_mount_new is a call to g_object_new like any other. There is no point in checking if g_object_new failed to create an object, because it will always succeed unless we have run out of virtual address space and in that case the program will be aborted anyway. https://bugzilla.gnome.org/show_bug.cgi?id=739075
Diffstat (limited to 'client')
-rw-r--r--client/gdaemonfile.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index 571da1ed..88f53b0d 100644
--- a/client/gdaemonfile.c
+++ b/client/gdaemonfile.c
@@ -2291,8 +2291,7 @@ g_daemon_file_find_enclosing_mount (GFile *file,
}
g_mount_info_unref (mount_info);
- if (mount)
- return G_MOUNT (mount);
+ return G_MOUNT (mount);
}
g_set_error_literal (error, G_IO_ERROR,
@@ -3492,12 +3491,8 @@ find_enclosing_mount_cb (GMountInfo *mount_info,
if (mount == NULL)
mount = g_daemon_mount_new (mount_info, NULL);
- if (mount)
- g_simple_async_result_set_op_res_gpointer (data->result, mount, g_object_unref);
- else
- g_simple_async_result_set_error (data->result, G_IO_ERROR, G_IO_ERROR_FAILED,
- "Internal error: \"%s\"",
- "Mount info did not yield a mount");
+ g_simple_async_result_set_op_res_gpointer (data->result, mount, g_object_unref);
+ goto out;
}
out: