mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 01:48:00 +02:00
test_connection_setup: Don't crash on unlikely OOM
If _dbus_loop_queue_dispatch fails with OOM, we'd try to free cd, while cd is already owned by the connection's timeout functions. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100317 Reviewed-by: Philip Withnall <withnall@endlessm.com> Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
929c15c797
commit
38ff6bd20d
1 changed files with 5 additions and 1 deletions
|
|
@ -108,7 +108,8 @@ test_connection_setup (TestMainContext *ctx,
|
|||
|
||||
dbus_connection_set_dispatch_status_function (connection, dispatch_status_function,
|
||||
loop, NULL);
|
||||
|
||||
/* ownership of cd taken */
|
||||
|
||||
cd = cdata_new (loop, connection);
|
||||
if (cd == NULL)
|
||||
goto nomem;
|
||||
|
|
@ -132,6 +133,9 @@ test_connection_setup (TestMainContext *ctx,
|
|||
cd, cdata_free))
|
||||
goto nomem;
|
||||
|
||||
/* ownership taken */
|
||||
cd = NULL;
|
||||
|
||||
if (dbus_connection_get_dispatch_status (connection) != DBUS_DISPATCH_COMPLETE)
|
||||
{
|
||||
if (!_dbus_loop_queue_dispatch (loop, connection))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue