mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 14:38:10 +02:00
add OOM handling
2008-01-15 John (J5) Palmieri <johnp@redhat.com> * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com> * dbus/dbus-internals.c (_dbus_read_uuid_file_without_creating, _dbus_create_uuid_file_exclusively): add OOM handling (FDO Bug #12952)
This commit is contained in:
parent
a6a22beeae
commit
c18415e2c6
2 changed files with 24 additions and 3 deletions
|
|
@ -1,3 +1,10 @@
|
|||
2008-01-15 John (J5) Palmieri <johnp@redhat.com>
|
||||
|
||||
* patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
|
||||
|
||||
* dbus/dbus-internals.c (_dbus_read_uuid_file_without_creating,
|
||||
_dbus_create_uuid_file_exclusively): add OOM handling
|
||||
|
||||
2008-01-15 John (J5) Palmieri <johnp@redhat.com>
|
||||
|
||||
* patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com>
|
||||
|
|
|
|||
|
|
@ -543,8 +543,18 @@ _dbus_read_uuid_file_without_creating (const DBusString *filename,
|
|||
DBusString decoded;
|
||||
int end;
|
||||
|
||||
_dbus_string_init (&contents);
|
||||
_dbus_string_init (&decoded);
|
||||
if (!_dbus_string_init (&contents))
|
||||
{
|
||||
_DBUS_SET_OOM (error);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!_dbus_string_init (&decoded))
|
||||
{
|
||||
_dbus_string_free (&contents);
|
||||
_DBUS_SET_OOM (error);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!_dbus_file_get_contents (&contents, filename, error))
|
||||
goto error;
|
||||
|
|
@ -608,7 +618,11 @@ _dbus_create_uuid_file_exclusively (const DBusString *filename,
|
|||
{
|
||||
DBusString encoded;
|
||||
|
||||
_dbus_string_init (&encoded);
|
||||
if (!_dbus_string_init (&encoded))
|
||||
{
|
||||
_DBUS_SET_OOM (error);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
_dbus_generate_uuid (uuid);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue