]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: add missing assertion 25692/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 10 Dec 2022 01:25:53 +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 ce9cecf118c70596fad7c86cecc014601e9a30ad..d3175b1b9de30c265ae23c520b344f8545e11a0b 100644 (file)
@@ -1814,6 +1814,8 @@ DnsTxtItem *dns_txt_item_copy(DnsTxtItem *first) {
 int dns_txt_item_new_empty(DnsTxtItem **ret) {
         DnsTxtItem *i;
 
+        assert(ret);
+
         /* RFC 6763, section 6.1 suggests to treat
          * empty TXT RRs as equivalent to a TXT record
          * with a single empty string. */
@@ -1823,7 +1825,6 @@ int dns_txt_item_new_empty(DnsTxtItem **ret) {
                 return -ENOMEM;
 
         *ret = i;
-
         return 0;
 }