systemd-resolved already has a dns_scope_free() function in
resolved-dns-scope.c for DnsScope. Since the one in dns-configuration.c
is only used internally, make it static.
This is necessary to allow systemd-resolved to be statically linked
with libsystemd-shared without symbol conflicts.
return 0;
}
-DNSScope* dns_scope_free(DNSScope *s) {
+static DNSScope* dns_scope_free(DNSScope *s) {
if (!s)
return NULL;
return mfree(s);
}
+DEFINE_TRIVIAL_CLEANUP_FUNC(DNSScope*, dns_scope_free);
+
DEFINE_PRIVATE_HASH_OPS_WITH_VALUE_DESTRUCTOR(
dns_scope_hash_ops,
void,
int ifindex;
} SearchDomain;
+SearchDomain* search_domain_free(SearchDomain *d);
+DEFINE_TRIVIAL_CLEANUP_FUNC(SearchDomain*, search_domain_free);
+
typedef struct DNSScope {
char *ifname;
int ifindex;
char *dns_over_tls_mode_str;
} DNSScope;
-DNSScope* dns_scope_free(DNSScope *s);
-DEFINE_TRIVIAL_CLEANUP_FUNC(DNSScope*, dns_scope_free);
-
-SearchDomain* search_domain_free(SearchDomain *d);
-DEFINE_TRIVIAL_CLEANUP_FUNC(SearchDomain*, search_domain_free);
-
typedef struct DNSConfiguration {
char *ifname;
int ifindex;