projects
/
platform
/
upstream
/
dbus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
78bf46a
)
_dbus_loop_new: don't crash on OOM allocating socket set
author
Simon McVittie
<simon.mcvittie@collabora.co.uk>
Wed, 2 Nov 2011 15:50:45 +0000
(15:50 +0000)
committer
Simon McVittie
<simon.mcvittie@collabora.co.uk>
Wed, 2 Nov 2011 15:50:45 +0000
(15:50 +0000)
Also don't leak the socket set if allocating watches failed, or
vice versa. Based on review feedback from wjt.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33337
dbus/dbus-mainloop.c
patch
|
blob
|
history
diff --git
a/dbus/dbus-mainloop.c
b/dbus/dbus-mainloop.c
index
383ac2c
..
e63019f
100644
(file)
--- a/
dbus/dbus-mainloop.c
+++ b/
dbus/dbus-mainloop.c
@@
-157,8
+157,14
@@
_dbus_loop_new (void)
loop->socket_set = _dbus_socket_set_new (0);
- if (loop->watches == NULL)
+ if (loop->watches == NULL
|| loop->socket_set == NULL
)
{
+ if (loop->watches != NULL)
+ _dbus_hash_table_unref (loop->watches);
+
+ if (loop->socket_set != NULL)
+ _dbus_socket_set_free (loop->socket_set);
+
dbus_free (loop);
return NULL;
}