From b7871c6ea836f8f357dfe78cabb9f90f08385660 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 23 Oct 2014 16:10:20 +0200 Subject: 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 --- client/gdaemonfile.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'client') 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: -- cgit v1.2.1