[gupnp] context-manager: Do not leak reference on context



commit 7a575068b4fa9e75e58d832f4e391790b6886533
Author: Jens Georg <mail jensge org>
Date:   Sat Aug 7 20:06:58 2021 +0200

    context-manager: Do not leak reference on context
    
    Applying the filter will leak a reference on the context.
    
    Unref the context after use.

 libgupnp/gupnp-context-manager.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/libgupnp/gupnp-context-manager.c b/libgupnp/gupnp-context-manager.c
index 534899d..c4948d2 100644
--- a/libgupnp/gupnp-context-manager.c
+++ b/libgupnp/gupnp-context-manager.c
@@ -271,6 +271,8 @@ gupnp_context_manager_filter_context (GUPnPContextFilter *context_filter,
                         match = gupnp_context_filter_check_context (
                                 context_filter,
                                 context);
+
+                        g_object_unref (context);
                 } else {
                         /* Re-activate all context, if needed */
                         match = TRUE;


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