]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/resolve/resolved-dns-trust-anchor.c
tree-wide: use TAKE_PTR() and TAKE_FD() macros
[thirdparty/systemd.git] / src / resolve / resolved-dns-trust-anchor.c
index c6e47ed0e902f9de01ea5f323083e77f32d7773c..fc7f26a46f3b390689f41b95b518ee7f6568dacd 100644 (file)
@@ -301,8 +301,7 @@ static int dns_trust_anchor_load_positive(DnsTrustAnchor *d, const char *path, u
                 rr->ds.algorithm = a;
                 rr->ds.digest_type = dt;
                 rr->ds.digest_size = l;
-                rr->ds.digest = dd;
-                dd = NULL;
+                rr->ds.digest = TAKE_PTR(dd);
 
         } else if (strcaseeq(type, "DNSKEY")) {
                 _cleanup_free_ char *flags = NULL, *protocol = NULL, *algorithm = NULL, *key = NULL;
@@ -354,8 +353,7 @@ static int dns_trust_anchor_load_positive(DnsTrustAnchor *d, const char *path, u
                 rr->dnskey.protocol = 3;
                 rr->dnskey.algorithm = a;
                 rr->dnskey.key_size = l;
-                rr->dnskey.key = k;
-                k = NULL;
+                rr->dnskey.key = TAKE_PTR(k);
 
         } else {
                 log_warning("RR type %s is not supported, ignoring line %s:%u.", type, path, line);