tree-wide: avoid uninitialized warning on _cleanup_ variables
With some versions of the compiler, the _cleanup_ attr makes it think the variable might be freed/closed when uninitialized, even though it cannot happen. The added cost is small enough to be worth the benefit, and optimized builds will help reduce it even further.
This commit is contained in:
@@ -1447,7 +1447,7 @@ int dns_scope_announce(DnsScope *scope, bool goodbye) {
|
||||
|
||||
/* Since all the active services are in the zone make them discoverable now. */
|
||||
SET_FOREACH(service_type, types) {
|
||||
_cleanup_(dns_resource_record_unrefp) DnsResourceRecord *rr;
|
||||
_cleanup_(dns_resource_record_unrefp) DnsResourceRecord *rr = NULL;
|
||||
|
||||
rr = dns_resource_record_new_full(DNS_CLASS_IN, DNS_TYPE_PTR,
|
||||
"_services._dns-sd._udp.local");
|
||||
|
||||
Reference in New Issue
Block a user