X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-daemon%2Fdbus-sync-service-resolver.c;h=ed7276afd4734ecbe56e0cb8f33b95dfff991752;hb=7a63625dc83196b8b026d5c87d3d3ed943dbe758;hp=6d39d4e9901192284e2359f1e8b1e31374aace99;hpb=037ca37a213d9e40258f5ebc3b00113df9f842d1;p=catta diff --git a/avahi-daemon/dbus-sync-service-resolver.c b/avahi-daemon/dbus-sync-service-resolver.c index 6d39d4e..ed7276a 100644 --- a/avahi-daemon/dbus-sync-service-resolver.c +++ b/avahi-daemon/dbus-sync-service-resolver.c @@ -90,12 +90,18 @@ void avahi_dbus_sync_service_resolver_callback( 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, @@ -124,5 +130,6 @@ void avahi_dbus_sync_service_resolver_callback( avahi_dbus_respond_error(server->bus, i->message, avahi_server_errno(avahi_server), NULL); } +finish: avahi_dbus_sync_service_resolver_free(i); }