]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
libdns: Remove useless checks for ISC_R_MEMORY, which cannot happen now
authorOndřej Surý <ondrej@sury.org>
Fri, 11 Oct 2019 22:15:51 +0000 (00:15 +0200)
committerOndřej Surý <ondrej@sury.org>
Mon, 4 Nov 2019 15:15:22 +0000 (16:15 +0100)
lib/dns/client.c

index 4cff788e2d6f57023478a24b199b025edc41a942..48ed6aa88c90490f18b952b9625c56fa8ac79590 100644 (file)
@@ -885,21 +885,12 @@ client_resfind(resctx_t *rctx, dns_fetchevent_t *event) {
                         * Otherwise, get some resource for copying the
                         * result.
                         */
+                       dns_name_t *aname = dns_fixedname_name(&rctx->name);
+
                        ansname = isc_mem_get(mctx, sizeof(*ansname));
-                       if (ansname == NULL)
-                               tresult = ISC_R_NOMEMORY;
-                       else {
-                               dns_name_t *aname;
-
-                               aname = dns_fixedname_name(&rctx->name);
-                               dns_name_init(ansname, NULL);
-                               tresult = dns_name_dup(aname, mctx, ansname);
-                               if (tresult != ISC_R_SUCCESS)
-                                       isc_mem_put(mctx, ansname,
-                                                   sizeof(*ansname));
-                       }
-                       if (tresult != ISC_R_SUCCESS)
-                               result = tresult;
+                       dns_name_init(ansname, NULL);
+
+                       (void)dns_name_dup(aname, mctx, ansname);
                }
 
                switch (result) {