[gvfs/gnome-3-22] dnssd: Free browser objects properly



commit 2b7842adbd23d79de933dd7e73f2e51c7ed4e2cc
Author: Ondrej Holy <oholy redhat com>
Date:   Thu Oct 13 12:35:22 2016 +0200

    dnssd: Free browser objects properly
    
    Browser objects are not currently freed by remove_browsers call,
    just the list is emptied. Free the browser objects for sure in order
    to avoid some use-after-free crashes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=631023

 daemon/gvfsbackenddnssd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gvfsbackenddnssd.c b/daemon/gvfsbackenddnssd.c
index dde7dff..ed88af5 100644
--- a/daemon/gvfsbackenddnssd.c
+++ b/daemon/gvfsbackenddnssd.c
@@ -700,7 +700,7 @@ add_browsers (GVfsBackendDnsSd *backend)
 static void
 remove_browsers (GVfsBackendDnsSd *backend)
 {
-  g_list_free (backend->browsers);
+  g_list_free_full (backend->browsers, (GDestroyNotify)avahi_service_browser_free);
   backend->browsers = NULL;
 }
 


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