X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-daemon%2Fdbus-service-type-browser.c;h=20afdbec76e160100ad6fa6d5fae97ca61ae9f77;hb=7a5b2f69af7d36d6cd4153142f125fa011784e03;hp=db7a038160bf52ed438b9ce5378bc325ff01732d;hpb=908e491f7d55209acfbb2595ab1ef5b24502d641;p=catta diff --git a/avahi-daemon/dbus-service-type-browser.c b/avahi-daemon/dbus-service-type-browser.c index db7a038..20afdbe 100644 --- a/avahi-daemon/dbus-service-type-browser.c +++ b/avahi-daemon/dbus-service-type-browser.c @@ -44,8 +44,8 @@ void avahi_dbus_service_type_browser_free(ServiceTypeBrowserInfo *i) { AVAHI_LLIST_REMOVE(ServiceTypeBrowserInfo, service_type_browsers, i->client->service_type_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_type_browser_impl(DBusConnection *c, DB /* Introspection */ if (dbus_message_is_method_call(m, DBUS_INTERFACE_INTROSPECTABLE, "Introspect")) - return avahi_dbus_handle_introspect(c, m, "ServiceTypeBrowser.introspect"); + return avahi_dbus_handle_introspect(c, m, "org.freedesktop.Avahi.ServiceTypeBrowser.xml"); /* Access control */ if (strcmp(dbus_message_get_sender(m), i->client->name)) @@ -109,6 +109,11 @@ void avahi_dbus_service_type_browser_callback(AvahiSServiceTypeBrowser *b, Avahi m = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_SERVICE_TYPE_BROWSER, avahi_dbus_map_browse_signal_name(event)); + if (!m) { + avahi_log_error("Failed allocate message"); + return; + } + if (event == AVAHI_BROWSER_NEW || event == AVAHI_BROWSER_REMOVE) { assert(type); assert(domain); @@ -127,5 +132,3 @@ void avahi_dbus_service_type_browser_callback(AvahiSServiceTypeBrowser *b, Avahi dbus_connection_send(server->bus, m, NULL); dbus_message_unref(m); } - -