[gupnp] Prevent dangling pointer
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gupnp] Prevent dangling pointer
- Date: Sun, 25 May 2014 09:21:34 +0000 (UTC)
commit bb6fbdd3272de42a2621adf563b60abc6960f235
Author: Jens Georg <mail jensge org>
Date: Sun May 25 09:44:21 2014 +0200
Prevent dangling pointer
Regression introduced with 8abfa8082997bf59cd20aba2bd86de0eb3f88279
- _dispose might be called multiple times, so g_list_free_full might have
been called on an already freed list
- emit_notifications left a dangling pointer which caused _dispose to crash
Signed-off-by: Jens Georg <mail jensge org>
libgupnp/gupnp-service-proxy.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/libgupnp/gupnp-service-proxy.c b/libgupnp/gupnp-service-proxy.c
index 0d8868a..d1d1c6a 100644
--- a/libgupnp/gupnp-service-proxy.c
+++ b/libgupnp/gupnp-service-proxy.c
@@ -296,6 +296,7 @@ gupnp_service_proxy_dispose (GObject *object)
g_list_free_full (proxy->priv->pending_notifies,
(GDestroyNotify) emit_notify_data_free);
+ proxy->priv->pending_notifies = NULL;
/* Call super */
object_class = G_OBJECT_CLASS (gupnp_service_proxy_parent_class);
@@ -1865,6 +1866,7 @@ emit_notifications (gpointer user_data)
/* Cleanup */
g_list_free_full (proxy->priv->pending_notifies,
(GDestroyNotify) emit_notify_data_free);
+ proxy->priv->pending_notifies = NULL;
proxy->priv->notify_idle_src = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]