diff options
author | David Zeuthen <davidz@redhat.com> | 2006-10-23 17:25:52 +0000 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2006-10-23 17:25:52 +0000 |
commit | cb905b58f068ba68ca8f6645b2c4e9b51ec61e3e (patch) | |
tree | 0f079682ca1d396c5df1e97086d83da87181588f /bus/desktop-file.c | |
parent | 8ea5a53324e2959157f8b47b88211728a7bff375 (diff) |
2006-10-23 David Zeuthen <davidz@redhat.com>
* 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
Diffstat (limited to 'bus/desktop-file.c')
-rw-r--r-- | bus/desktop-file.c | 13 |
1 files changed, 12 insertions, 1 deletions
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)) { |