dns_add_new_service() links a _cleanup_ service into the browser
before copying its record and registering its maintenance timer has fully
succeeded. A timer setup failure then frees the service while leaving the
list head pointing at it.
Follow-up for
8458b7fb91ea5e5109b6f3c94f8a781a120c798b
.query = NULL,
.rr_ttl_state = DNS_RECORD_TTL_STATE_80_PERCENT,
};
-
- LIST_PREPEND(dns_services, sb->dns_services, s);
+ if (!s->rr)
+ return log_oom();
/* Schedule the first cache maintenance query at 80% of the record's
* TTL. Subsequent queries issued at 5% increments until 100% of the
r,
"Failed to schedule mDNS maintenance query for DNS service: %m");
+ LIST_PREPEND(dns_services, sb->dns_services, s);
+
TAKE_PTR(s);
return 0;
}