[gupnp/gupnp-1.4] context: If server fails to listen, unref it



commit 8056d7ad5c7353ee2b8867302e23fa180f8c9003
Author: Jens Georg <mail jensge org>
Date:   Sun Nov 21 16:20:16 2021 +0100

    context: If server fails to listen, unref it
    
    So g_initable_new fails properly

 libgupnp/gupnp-context.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/libgupnp/gupnp-context.c b/libgupnp/gupnp-context.c
index efec13f..fbd8440 100644
--- a/libgupnp/gupnp-context.c
+++ b/libgupnp/gupnp-context.c
@@ -608,6 +608,7 @@ gupnp_context_get_server (GUPnPContext *context)
 
                 if (! soup_server_listen (priv->server,
                                           addr, (SoupServerListenOptions) 0, &error)) {
+                        g_clear_object(&priv->server);
                         g_warning ("GUPnPContext: Unable to listen on %s:%u %s", ip, priv->port, 
error->message);
                         g_error_free (error);
                 }


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