resolve: shorten code a bit

This commit is contained in:
Yu Watanabe
2022-12-10 10:32:29 +09:00
parent 494ef16743
commit 14822ede9f
+2 -4
View File
@@ -1801,10 +1801,8 @@ DnsTxtItem *dns_txt_item_copy(DnsTxtItem *first) {
DnsTxtItem *j;
j = memdup(i, offsetof(DnsTxtItem, data) + i->length + 1);
if (!j) {
dns_txt_item_free_all(copy);
return NULL;
}
if (!j)
return dns_txt_item_free_all(copy);
LIST_INSERT_AFTER(items, copy, end, j);
end = j;