diff options
author | Mike Gorse <mgorse@novell.com> | 2011-05-05 17:14:02 -0500 |
---|---|---|
committer | Mike Gorse <mgorse@novell.com> | 2011-05-05 17:14:02 -0500 |
commit | 0af92999fa225c8c3a7dd2d55208e96907fd929d (patch) | |
tree | 229cf67b9203be96962e9605edb4a3b6a1444b55 /atspi/atspi-hyperlink.c | |
parent | 025bcc69f7fcede5f04194deae9b0c8f6a55b8ca (diff) | |
download | at-spi2-core-0af92999fa225c8c3a7dd2d55208e96907fd929d.tar.gz |
Remove some redundant out-of-memory checks
If malloc returns NULL, then g_malloc will call g_error and thus abort, so
it is redundant to check the return value of g_new0 and the like, since glib
will already have aborted the program rather than returning a NULL value.
"Cleaning up" the code by removing some of these checks.
Diffstat (limited to 'atspi/atspi-hyperlink.c')
-rw-r--r-- | atspi/atspi-hyperlink.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/atspi/atspi-hyperlink.c b/atspi/atspi-hyperlink.c index 57c4b815..c2f3d5b8 100644 --- a/atspi/atspi-hyperlink.c +++ b/atspi/atspi-hyperlink.c @@ -136,10 +136,9 @@ atspi_hyperlink_get_index_range (AtspiHyperlink *obj, GError **error) dbus_int32_t d_start_offset, d_end_offset; AtspiRange *ret = g_new (AtspiRange, 1); - if (ret) - ret->start_offset = ret->end_offset = -1; + ret->start_offset = ret->end_offset = -1; - if (!obj || !ret) + if (!obj) return ret; _atspi_dbus_call (obj, atspi_interface_hyperlink, "GetIndexRange", error, "=>ii", &d_start_offset, &d_end_offset); |