]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: shorten code a bit
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 10 Dec 2022 01:25:38 +0000 (10:25 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 10 Dec 2022 01:32:29 +0000 (10:32 +0900)
src/resolve/resolved-dns-rr.c

index 5f890f950938a2e8685ef7e8d0e7ea3d74513952..ce9cecf118c70596fad7c86cecc014601e9a30ad 100644 (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;