]> git.meshlink.io Git - catta/blobdiff - avahi-daemon/dbus-service-browser.c
man: clarify avahi-daemon.conf.5
[catta] / avahi-daemon / dbus-service-browser.c
index d59d8f954cded6d070cd6ad21177803c6aaa0a2b..104165b83e71fadd02ed5adecd6b6997339f4395 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /***
   This file is part of avahi.
 
@@ -46,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);
 }
@@ -107,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 */