if (sd_radv_prefix_new(&prefix->radv_prefix) < 0)
return -ENOMEM;
- *ret = prefix;
- prefix = NULL;
+ *ret = TAKE_PTR(prefix);
return 0;
}
if (section_line) {
prefix = hashmap_get(network->prefixes_by_section, n);
if (prefix) {
- *ret = prefix;
- prefix = NULL;
+ *ret = TAKE_PTR(prefix);
return 0;
}
return r;
if (filename) {
- prefix->section = n;
- n = NULL;
+ prefix->section = TAKE_PTR(n);
r = hashmap_put(network->prefixes_by_section, prefix->section,
prefix);
LIST_APPEND(prefixes, network->static_prefixes, prefix);
network->n_static_prefixes++;
- *ret = prefix;
- prefix = NULL;
+ *ret = TAKE_PTR(prefix);
return 0;
}
}
if (addresses) {
- *dns = addresses;
- addresses = NULL;
+ *dns = TAKE_PTR(addresses);
*n_dns = n_addresses;
}