[gssdp] gssdp-client: Fix GLib warning if host IP is not known



commit b8fdcc473de0b26483205df42c70ee6b32b9de8d
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sat Jan 16 09:23:02 2016 +0000

    gssdp-client: Fix GLib warning if host IP is not known
    
    Prevent calling a GInetAddress constructor with a NULL IP address if the
    host IP could not be determined. (This is happening on my Linux system;
    I have not investigated the cause.)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760702

 libgssdp/gssdp-client.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libgssdp/gssdp-client.c b/libgssdp/gssdp-client.c
index b3ec56d..6478df8 100644
--- a/libgssdp/gssdp-client.c
+++ b/libgssdp/gssdp-client.c
@@ -1800,7 +1800,8 @@ init_network_info (GSSDPClient *client, GError **error)
             client->priv->device.host_ip == NULL)
                 get_host_ip (&(client->priv->device));
 
-        if (client->priv->device.host_addr == NULL) {
+        if (client->priv->device.host_addr == NULL &&
+            client->priv->device.host_ip != NULL) {
                 client->priv->device.host_addr =
                                 g_inet_address_new_from_string
                                     (client->priv->device.host_ip);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]