summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2021-11-21 16:25:47 +0100
committerJens Georg <mail@jensge.org>2021-11-21 16:25:47 +0100
commit3083640883bba8668b462242cfa2e49dd0669895 (patch)
tree414de21b1651b6dd90656d7d158890bc723d34b6
parent8ce9544b3c3ebc0385a7c5942c09b734dc7e4ee2 (diff)
downloadgupnp-3083640883bba8668b462242cfa2e49dd0669895.tar.gz
Context: Unref server if listen fails
So that g_initable_new fails properly
-rw-r--r--libgupnp/gupnp-context.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libgupnp/gupnp-context.c b/libgupnp/gupnp-context.c
index 0d37269..b8214a1 100644
--- a/libgupnp/gupnp-context.c
+++ b/libgupnp/gupnp-context.c
@@ -540,7 +540,8 @@ gupnp_context_get_server (GUPnPContext *context)
if (! soup_server_listen (priv->server,
addr, (SoupServerListenOptions) 0, &error)) {
- g_warning ("GUPnPContext: Unable to listen on %s:%u %s", ip, port, error->message);
+ g_clear_object (&priv->server);
+ g_warning ("Unable to listen on %s:%u %s", ip, port, error->message);
g_error_free (error);
}