summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn (J5) Palmieri <johnp@redhat.com>2008-01-15 13:53:54 -0500
committerJohn (J5) Palmieri <johnp@redhat.com>2008-01-15 13:53:54 -0500
commitc18415e2c6e151b773a90e66188714124ee8b867 (patch)
tree8ca7fc9d4726809d56d0b6a653c604f0097aa10b
parenta6a22beeae1e710d211d773d78e21c95f4ebe536 (diff)
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)
-rw-r--r--ChangeLog7
-rw-r--r--dbus/dbus-internals.c20
2 files changed, 24 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 247c09e7..88d0a572 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,13 @@
* 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>
+
* dbus/dbus-spawn.c (babysit, babysitter_iteration): add error
handling when polling (FDO Bug #12954)
diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c
index c99bee1a..f3ca7c55 100644
--- a/dbus/dbus-internals.c
+++ b/dbus/dbus-internals.c
@@ -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);