mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 22:50:29 +00:00
sd-journal: use TAKE_PTR() a bit more
This commit is contained in:
@@ -171,7 +171,8 @@ static int finish_item(
|
||||
|
||||
if (ordered_hashmap_update(h, i, combined) < 0)
|
||||
return log_oom();
|
||||
combined = NULL;
|
||||
|
||||
TAKE_PTR(combined);
|
||||
free(prev);
|
||||
} else {
|
||||
/* A new item */
|
||||
@@ -181,8 +182,9 @@ static int finish_item(
|
||||
|
||||
if (ordered_hashmap_put(h, i, combined) < 0)
|
||||
return log_oom();
|
||||
i = NULL;
|
||||
combined = NULL;
|
||||
|
||||
TAKE_PTR(i);
|
||||
TAKE_PTR(combined);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user