summaryrefslogtreecommitdiffstats
path: root/src/resolve/resolved-dns-rr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/resolve/resolved-dns-rr.c')
-rw-r--r--src/resolve/resolved-dns-rr.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c
index d3175b1b9d..78739d588d 100644
--- a/src/resolve/resolved-dns-rr.c
+++ b/src/resolve/resolved-dns-rr.c
@@ -1229,12 +1229,11 @@ int dns_resource_record_to_wire_format(DnsResourceRecord *rr, bool canonical) {
assert(packet._data);
free(rr->wire_format);
- rr->wire_format = packet._data;
+ rr->wire_format = TAKE_PTR(packet._data);
rr->wire_format_size = packet.size;
rr->wire_format_rdata_offset = rds;
rr->wire_format_canonical = canonical;
- packet._data = NULL;
dns_packet_unref(&packet);
return 0;