diff options
author | John (J5) Palmieri <johnp@redhat.com> | 2006-08-08 23:29:03 +0000 |
---|---|---|
committer | John (J5) Palmieri <johnp@redhat.com> | 2006-08-08 23:29:03 +0000 |
commit | 9a3145b9f3cb0d7d570230aaa6193f87e3bea604 (patch) | |
tree | 1d24b643c7086b8732a68c3a14372482ac472c09 /bus/expirelist.c | |
parent | 1fa8e404a4fd9fc723b0a00be09c3c9fce0cfff3 (diff) |
These are all patches from Kjartan Maraas <kmaraas at gnome dot org>
with cleanups of bugs found from Coverity reports:
* dbus/dbus-sysdeps-util.c (_dbus_write_pid_file):
close the file on error to avoid a leak
* bus/expirelist.c (bus_expire_list_test):
Check for NULL on dbus_new0
* bus/activation.c (update_directory):
remove dead code
* bus/config-parser.c (merge_service_context_hash, start_selinux_child):
Fix some leaks
* bus/bus.c (process_config_every_time):
Fixed a leak
* bus/desktop-file.c (parse_key_value):
Fixed leak
* bus/selinux.c (bus_selinux_id_table_insert):
Fixed leak
Diffstat (limited to 'bus/expirelist.c')
-rw-r--r-- | bus/expirelist.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bus/expirelist.c b/bus/expirelist.c index 422f3e40..6fa1c6e1 100644 --- a/bus/expirelist.c +++ b/bus/expirelist.c @@ -248,7 +248,9 @@ bus_expire_list_test (const DBusString *test_data_dir) long tv_sec_past, tv_usec_past; TestExpireItem *item; int next_interval; - + dbus_bool_t result = FALSE; + + loop = _dbus_loop_new (); _dbus_assert (loop != NULL); @@ -276,6 +278,9 @@ bus_expire_list_test (const DBusString *test_data_dir) item = dbus_new0 (TestExpireItem, 1); + if (item == NULL) + goto oom; + item->item.added_tv_sec = tv_sec; item->item.added_tv_usec = tv_usec; if (!_dbus_list_append (&list->items, item)) @@ -308,7 +313,10 @@ bus_expire_list_test (const DBusString *test_data_dir) bus_expire_list_free (list); _dbus_loop_unref (loop); - return TRUE; + result = TRUE; + + oom: + return result; } #endif /* DBUS_BUILD_TESTS */ |