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>
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;
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))