diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c index eb5592d3cf2..4056bda5585 100644 --- a/src/resolve/resolved-dns-rr.c +++ b/src/resolve/resolved-dns-rr.c @@ -517,9 +517,13 @@ DnsResourceRecord* dns_resource_record_unref(DnsResourceRecord *rr) { case DNS_TYPE_OPENPGPKEY: default: - free(rr->generic.data); + if (!rr->unparseable) + free(rr->generic.data); } + if (rr->unparseable) + free(rr->generic.data); + free(rr->wire_format); dns_resource_key_unref(rr->key); }