]> git.meshlink.io Git - catta/blobdiff - avahi-core/browse.c
fix segfault when destructing multicast lookup objects
[catta] / avahi-core / browse.c
index dd4fe3c214e7c7b589b24dc8e30327deb5072538..16d89548442ac1c3ed8f813f04170314718103c5 100644 (file)
@@ -195,7 +195,6 @@ static void browser_cancel(AvahiSRecordBrowser *b) {
     }
 }
 
-
 static void lookup_wide_area_callback(
     AvahiWideAreaLookupEngine *e,
     AvahiBrowserEvent event,
@@ -208,6 +207,7 @@ static void lookup_wide_area_callback(
 
     assert(e);
     assert(l);
+    assert(l->ref >= 1);
 
     b = l->record_browser;
 
@@ -422,6 +422,7 @@ static void lookup_handle_cname(AvahiSRBLookup *l, AvahiIfIndex interface, Avahi
     l->cname_lookups = avahi_rlist_prepend(l->cname_lookups, lookup_ref(n));
 
     lookup_go(n);
+    lookup_unref(n);
 }
 
 static void lookup_drop_cname(AvahiSRBLookup *l, AvahiIfIndex interface, AvahiProtocol protocol, AvahiLookupFlags flags, AvahiRecord *r) {