]> git.meshlink.io Git - catta/blobdiff - avahi-daemon/dbus-service-browser.c
fix avahi_netlink_new to allow multiple netlinks per process
[catta] / avahi-daemon / dbus-service-browser.c
index 39251f5e78fb0903c5111c7a3aaed3ed57a3ff5b..962dca0cde10e02b8276b3acd0fe16854f51553c 100644 (file)
@@ -44,8 +44,8 @@ void avahi_dbus_service_browser_free(ServiceBrowserInfo *i) {
 
     AVAHI_LLIST_REMOVE(ServiceBrowserInfo, service_browsers, i->client->service_browsers, i);
 
+    assert(i->client->n_objects >= 1);
     i->client->n_objects--;
-    assert(i->client->n_objects >= 0);
 
     avahi_free(i);
 }
@@ -67,7 +67,7 @@ DBusHandlerResult avahi_dbus_msg_service_browser_impl(DBusConnection *c, DBusMes
 
     /* Introspection */
     if (dbus_message_is_method_call(m, DBUS_INTERFACE_INTROSPECTABLE, "Introspect"))
-        return avahi_dbus_handle_introspect(c, m, "ServiceBrowser.introspect");
+        return avahi_dbus_handle_introspect(c, m, "org.freedesktop.Avahi.ServiceBrowser.xml");
 
     /* Access control */
     if (strcmp(dbus_message_get_sender(m), i->client->name))
@@ -105,6 +105,11 @@ void avahi_dbus_service_browser_callback(AvahiSServiceBrowser *b, AvahiIfIndex i
 
     m = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_SERVICE_BROWSER, avahi_dbus_map_browse_signal_name(event));
 
+    if (!m) {
+        avahi_log_error("Failed allocate message");
+        return;
+    }
+
     if (event == AVAHI_BROWSER_NEW) {
         /* Patch in AVAHI_LOOKUP_RESULT_OUR_OWN */