]> 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>
Tue, 5 Nov 2019 08:48:50 +0000 (09:48 +0100)
(cherry picked from commit 80b55d25de1c116f2aad7c9585689f392e314ae7)

lib/dns/client.c

index 172786b15daa8280fa1eb27e2a2d8be670350a1f..85731df56e9d382ab3584a0b744094e317cdb8b2 100644 (file)
@@ -933,21 +933,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) {