summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/resolve/resolved-dns-rr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-rr.c b/src/resolve/resolved-dns-rr.c
index 78739d588d..44d1d1f1e6 100644
--- a/src/resolve/resolved-dns-rr.c
+++ b/src/resolve/resolved-dns-rr.c
@@ -1222,8 +1222,10 @@ int dns_resource_record_to_wire_format(DnsResourceRecord *rr, bool canonical) {
return 0;
r = dns_packet_append_rr(&packet, rr, 0, &start, &rds);
- if (r < 0)
+ if (r < 0) {
+ dns_packet_unref(&packet);
return r;
+ }
assert(start == 0);
assert(packet._data);