[gssdp/gssdp_1.0] client: Fail init if get_host_ip fails



commit 6b8b008b0917bbce2577413626560f3e5ad8e73d
Author: Jens Georg <mail jensge org>
Date:   Sun Jul 5 14:12:56 2020 +0200

    client: Fail init if get_host_ip fails

 libgssdp/gssdp-client.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/libgssdp/gssdp-client.c b/libgssdp/gssdp-client.c
index 9ce1dd2..735caf7 100644
--- a/libgssdp/gssdp-client.c
+++ b/libgssdp/gssdp-client.c
@@ -2056,7 +2056,13 @@ init_network_info (GSSDPClient *client, GError **error)
 {
         gboolean ret = TRUE;
 
-        get_host_ip (&(client->priv->device));
+        if (!get_host_ip (&(client->priv->device))) {
+                g_set_error_literal (error,
+                                     GSSDP_ERROR,
+                                     GSSDP_ERROR_FAILED,
+                                     "Could not determine network device");
+                ret = FALSE;
+        }
 
         if (client->priv->device.iface_name == NULL) {
                 g_set_error_literal (error,


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