1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00

resolve: add missing OOM check

This commit is contained in:
Lennart Poettering 2022-02-01 17:38:12 +01:00 committed by Yu Watanabe
parent 86838bf08b
commit 7ac29d2dab

View File

@ -1458,12 +1458,16 @@ int dns_scope_announce(DnsScope *scope, bool goodbye) {
"_services._dns-sd._udp.local");
if (!rr)
return log_oom();
rr->ptr.name = strdup(service_type);
if (!rr->ptr.name)
return log_oom();
rr->ttl = MDNS_DEFAULT_TTL;
r = dns_zone_put(&scope->zone, scope, rr, false);
if (r < 0)
log_warning_errno(r, "Failed to add DNS-SD PTR record to MDNS zone: %m");
log_warning_errno(r, "Failed to add DNS-SD PTR record to MDNS zone, ignoring: %m");
r = dns_answer_add(answer, rr, 0, 0, NULL);
if (r < 0)