reply = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_ADDRESS_RESOLVER, avahi_dbus_map_resolve_signal_name(event));
+ if (!reply) {
+ avahi_log_error("Failed allocate message");
+ return;
+ }
+
if (event == AVAHI_RESOLVER_FOUND) {
char t[AVAHI_ADDRESS_STR_MAX], *pt = t;
int32_t i_interface, i_protocol, i_aprotocol;
reply = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_HOST_NAME_RESOLVER, avahi_dbus_map_resolve_signal_name(event));
+ if (!reply) {
+ avahi_log_error("Failed allocate message");
+ return;
+ }
+
if (event == AVAHI_RESOLVER_FOUND) {
char t[AVAHI_ADDRESS_STR_MAX], *pt = t;
int32_t i_interface, i_protocol, i_aprotocol;
reply = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_SERVICE_RESOLVER, avahi_dbus_map_resolve_signal_name(event));
+ if (!reply) {
+ avahi_log_error("Failed allocate message");
+ return;
+ }
+
if (event == AVAHI_RESOLVER_FOUND) {
char t[AVAHI_ADDRESS_STR_MAX], *pt = t;
int32_t i_interface, i_protocol, i_aprotocol;
m = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_DOMAIN_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(domain);
dbus_message_append_args(
m = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_ENTRY_GROUP, "StateChanged");
+ if (!m) {
+ avahi_log_error("Failed allocate message");
+ return;
+ }
+
t = (int32_t) state;
if (state == AVAHI_ENTRY_GROUP_FAILURE)
e = avahi_error_number_to_dbus(avahi_server_errno(s));
return;
m = dbus_message_new_signal(AVAHI_DBUS_PATH_SERVER, AVAHI_DBUS_INTERFACE_SERVER, "StateChanged");
+
+ if (!m) {
+ avahi_log_error("Failed allocate message");
+ return;
+ }
+
t = (int32_t) state;
if (state == AVAHI_SERVER_COLLISION)
m = dbus_message_new_signal(i->path, AVAHI_DBUS_INTERFACE_RECORD_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) {
uint8_t rdata[0xFFFF];
size_t size;
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 */
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);
u_flags = (uint32_t) flags;
reply = dbus_message_new_method_return(i->message);
+
+ if (!reply) {
+ avahi_log_error("Failed allocate message");
+ goto finish;
+ }
+
dbus_message_append_args(
reply,
DBUS_TYPE_INT32, &i_interface,
avahi_dbus_respond_error(server->bus, i->message, avahi_server_errno(avahi_server), NULL);
}
+finish:
avahi_dbus_sync_address_resolver_free(i);
}
-
u_flags = (uint32_t) flags;
reply = dbus_message_new_method_return(i->message);
+
+ if (!reply) {
+ avahi_log_error("Failed allocate message");
+ goto finish;
+ }
+
dbus_message_append_args(
reply,
DBUS_TYPE_INT32, &i_interface,
avahi_dbus_respond_error(server->bus, i->message, avahi_server_errno(avahi_server), NULL);
}
+finish:
avahi_dbus_sync_host_name_resolver_free(i);
}
-
i_interface = (int32_t) interface;
i_protocol = (int32_t) protocol;
if (a)
- i_aprotocol = (int32_t) a->proto;
- else
- i_aprotocol = AVAHI_PROTO_UNSPEC;
+ i_aprotocol = (int32_t) a->proto;
+ else
+ i_aprotocol = AVAHI_PROTO_UNSPEC;
u_flags = (uint32_t) flags;
reply = dbus_message_new_method_return(i->message);
+
+ if (!reply) {
+ avahi_log_error("Failed allocate message");
+ goto finish;
+ }
+
dbus_message_append_args(
reply,
DBUS_TYPE_INT32, &i_interface,
avahi_dbus_respond_error(server->bus, i->message, avahi_server_errno(avahi_server), NULL);
}
+finish:
avahi_dbus_sync_service_resolver_free(i);
}
text = avahi_strerror(error);
reply = dbus_message_new_error(m, avahi_error_number_to_dbus(error), text);
+
+ if (!reply) {
+ avahi_log_error("Failed allocate message");
+ return DBUS_HANDLER_RESULT_NEED_MEMORY;
+ }
+
dbus_connection_send(c, reply, NULL);
dbus_message_unref(reply);
DBusMessage *reply;
reply = dbus_message_new_method_return(m);
+
+ if (!reply) {
+ avahi_log_error("Failed allocate message");
+ return DBUS_HANDLER_RESULT_NEED_MEMORY;
+ }
+
dbus_message_append_args(reply, DBUS_TYPE_STRING, &text, DBUS_TYPE_INVALID);
dbus_connection_send(c, reply, NULL);
dbus_message_unref(reply);
DBusMessage *reply;
reply = dbus_message_new_method_return(m);
+
+ if (!reply) {
+ avahi_log_error("Failed allocate message");
+ return DBUS_HANDLER_RESULT_NEED_MEMORY;
+ }
+
dbus_message_append_args(reply, DBUS_TYPE_INT32, &i, DBUS_TYPE_INVALID);
dbus_connection_send(c, reply, NULL);
dbus_message_unref(reply);
DBusMessage *reply;
reply = dbus_message_new_method_return(m);
+
+ if (!reply) {
+ avahi_log_error("Failed allocate message");
+ return DBUS_HANDLER_RESULT_NEED_MEMORY;
+ }
+
dbus_message_append_args(reply, DBUS_TYPE_UINT32, &u, DBUS_TYPE_INVALID);
dbus_connection_send(c, reply, NULL);
dbus_message_unref(reply);
DBusMessage *reply;
reply = dbus_message_new_method_return(m);
+
+ if (!reply) {
+ avahi_log_error("Failed allocate message");
+ return DBUS_HANDLER_RESULT_NEED_MEMORY;
+ }
+
dbus_message_append_args(reply, DBUS_TYPE_BOOLEAN, &b, DBUS_TYPE_INVALID);
dbus_connection_send(c, reply, NULL);
dbus_message_unref(reply);
DBusMessage *reply;
reply = dbus_message_new_method_return(m);
+
+ if (!reply) {
+ avahi_log_error("Failed allocate message");
+ return DBUS_HANDLER_RESULT_NEED_MEMORY;
+ }
+
dbus_connection_send(c, reply, NULL);
dbus_message_unref(reply);
DBusMessage *reply;
reply = dbus_message_new_method_return(m);
+
+ if (!reply) {
+ avahi_log_error("Failed allocate message");
+ return DBUS_HANDLER_RESULT_NEED_MEMORY;
+ }
+
dbus_message_append_args(reply, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID);
dbus_connection_send(c, reply, NULL);
dbus_message_unref(reply);