if (i->entry_group)
avahi_s_entry_group_free(i->entry_group);
- dbus_connection_unregister_object_path(server->bus, i->path);
- avahi_free(i->path);
+
+ if (i->path) {
+ dbus_connection_unregister_object_path(server->bus, i->path);
+ avahi_free(i->path);
+ }
AVAHI_LLIST_REMOVE(EntryGroupInfo, entry_groups, i->client->entry_groups, i);
i->client->n_objects--;
goto fail;
}
- avahi_s_entry_group_commit(i->entry_group);
+ if (avahi_s_entry_group_commit(i->entry_group) < 0)
+ return avahi_dbus_respond_error(c, m, avahi_server_errno(avahi_server), NULL);
+
return avahi_dbus_respond_ok(c, m);