summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteffen Jaeckel <jaeckel@mind.be>2015-11-25 13:03:04 +0000
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>2015-11-25 13:05:08 +0000
commit96f81ae3cd4dd1b43b745ce9c01b84fc0c78c9db (patch)
tree02a506b299af26c267e34d3248e6449387944281
parent45593fe88e9aabcd26fc610dc3963326ed662936 (diff)
downloadgeoclue-96f81ae3cd4dd1b43b745ce9c01b84fc0c78c9db.tar.gz
nmea-source: Add a NULL check
If geoclue fails to connect to avahi service, the client pointer will be NULL in that case and therefore geoclue will crash on trying to free this NULL pointer. Let's only free the pointer if it's not NULL.
-rw-r--r--src/gclue-nmea-source.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gclue-nmea-source.c b/src/gclue-nmea-source.c
index 30d2146..873c79a 100644
--- a/src/gclue-nmea-source.c
+++ b/src/gclue-nmea-source.c
@@ -593,7 +593,8 @@ gclue_nmea_source_finalize (GObject *gnmea)
g_clear_object (&priv->connection);
g_clear_object (&priv->client);
g_clear_object (&priv->cancellable);
- avahi_client_free (priv->avahi_client);
+ if (priv->avahi_client)
+ avahi_client_free (priv->avahi_client);
g_list_free_full (priv->all_services,
avahi_service_free);
}