From cb905b58f068ba68ca8f6645b2c4e9b51ec61e3e Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Mon, 23 Oct 2006 17:25:52 +0000 Subject: 2006-10-23 David Zeuthen * dbus/dbus-memory.c: Use atomic variable to protect n_blocks_outstanding otherwise OOM will be reported using SMP on some arches * bus/dispatch.c: Add missing end of line characters * bus/desktop-file.c (parse_section_start, parse_key_value) (bus_desktop_file_load): Propertly handle OOM * dbus/dbus-threads.c (init_uninitialized_locks): Check that thread_init_generation equals _dbus_current_generation, not 0 --- bus/desktop-file.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'bus/desktop-file.c') diff --git a/bus/desktop-file.c b/bus/desktop-file.c index 407044c9..d798bb12 100644 --- a/bus/desktop-file.c +++ b/bus/desktop-file.c @@ -430,6 +430,8 @@ parse_section_start (BusDesktopFileParser *parser, DBusError *error) if (open_section (parser, section_name) == NULL) { dbus_free (section_name); + parser_free (parser); + BUS_SET_OOM (error); return FALSE; } @@ -527,6 +529,7 @@ parse_key_value (BusDesktopFileParser *parser, DBusError *error) { dbus_free (value); parser_free (parser); + BUS_SET_OOM (error); return FALSE; } @@ -534,21 +537,26 @@ parse_key_value (BusDesktopFileParser *parser, DBusError *error) { dbus_free (value); parser_free (parser); + BUS_SET_OOM (error); return FALSE; } if (!_dbus_string_copy_len (&parser->data, key_start, key_end - key_start, &key, 0)) { + _dbus_string_free (&key); dbus_free (value); parser_free (parser); + BUS_SET_OOM (error); return FALSE; } if (!_dbus_string_steal_data (&key, &tmp)) { + _dbus_string_free (&key); dbus_free (value); parser_free (parser); + BUS_SET_OOM (error); return FALSE; } @@ -633,7 +641,10 @@ bus_desktop_file_load (DBusString *filename, } if (!_dbus_string_init (&str)) - return NULL; + { + BUS_SET_OOM (error); + return NULL; + } if (!_dbus_file_get_contents (&str, filename, error)) { -- cgit