mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-14 05:16:18 +01:00
GDBusProxy: on_properties_changed initialize some variables
This avoids calling g_variant_unref and g_free on uninitialized memory if PropertiesChanged is received in the creating thread's thread-default main context's thread, at the same time as releasing the last ref in another thread. This would result in "goto out" before the variables freed after that label had been initialized to NULL. Based on a patch by Simon McVittie, bug 656282
This commit is contained in:
parent
655299a057
commit
ae496a52a9
@ -928,6 +928,9 @@ on_properties_changed (GDBusConnection *connection,
|
|||||||
GVariant *value;
|
GVariant *value;
|
||||||
guint n;
|
guint n;
|
||||||
|
|
||||||
|
changed_properties = NULL;
|
||||||
|
invalidated_properties = NULL;
|
||||||
|
|
||||||
G_LOCK (signal_subscription_lock);
|
G_LOCK (signal_subscription_lock);
|
||||||
proxy = data->proxy;
|
proxy = data->proxy;
|
||||||
if (proxy == NULL)
|
if (proxy == NULL)
|
||||||
@ -941,9 +944,6 @@ on_properties_changed (GDBusConnection *connection,
|
|||||||
G_UNLOCK (signal_subscription_lock);
|
G_UNLOCK (signal_subscription_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
changed_properties = NULL;
|
|
||||||
invalidated_properties = NULL;
|
|
||||||
|
|
||||||
if (!proxy->priv->initialized)
|
if (!proxy->priv->initialized)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user