if (ordered_hashmap_update(h, i, combined) < 0)
return log_oom();
- combined = NULL;
+
+ TAKE_PTR(combined);
free(prev);
} else {
/* A new item */
if (ordered_hashmap_put(h, i, combined) < 0)
return log_oom();
- i = NULL;
- combined = NULL;
+
+ TAKE_PTR(i);
+ TAKE_PTR(combined);
}
return 0;
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;