[gupnp] ServiceProxy: Fix leak in subscribe



commit 256e178c8988373382ae959bdd565d1504dbe42f
Author: Jens Georg <mail jensge org>
Date:   Fri Jun 10 01:35:12 2022 +0200

    ServiceProxy: Fix leak in subscribe
    
    The code did close, but not unref the InputStream. That caused a leak of
    the input stream and the SoupMessage for each (re-)subscription.
    
    Fixes #70

 libgupnp/gupnp-service-proxy.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/libgupnp/gupnp-service-proxy.c b/libgupnp/gupnp-service-proxy.c
index 5159d6a..466885f 100644
--- a/libgupnp/gupnp-service-proxy.c
+++ b/libgupnp/gupnp-service-proxy.c
@@ -1158,6 +1158,7 @@ subscribe_got_response (GObject *source, GAsyncResult *res, gpointer user_data)
 
         // We don't need the body, it should be empty anyway
         g_input_stream_close (is, NULL, NULL);
+        g_object_unref (is);
 
         /* Remove subscription timeout */
         g_clear_pointer (&priv->subscription_timeout_src, g_source_destroy);


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