diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-06-25 23:12:57 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-06-25 23:12:57 +0200 |
commit | 226060be021ca168aba33410b49e89a1f8bf4a00 (patch) | |
tree | 0f14c431b635223ea68884b005a3a3e04367f2b9 /avahi-daemon/dbus-sync-service-resolver.c | |
parent | 037ca37a213d9e40258f5ebc3b00113df9f842d1 (diff) |
daemon: add some minimal OOM checking against D-Bus
Diffstat (limited to 'avahi-daemon/dbus-sync-service-resolver.c')
-rw-r--r-- | avahi-daemon/dbus-sync-service-resolver.c | 13 |
1 files changed, 10 insertions, 3 deletions
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); } |