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:
parent
86838bf08b
commit
7ac29d2dab
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user