]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
check returns from putstr and putnull
authorMark Andrews <marka@isc.org>
Tue, 18 Nov 2014 01:21:20 +0000 (12:21 +1100)
committerMark Andrews <marka@isc.org>
Tue, 18 Nov 2014 01:21:20 +0000 (12:21 +1100)
bin/named/server.c

index 6c947f8dbce5ce31eb3998866364e4ad146ef9e5..cd868324df0a3f7676107451bc5068325b9b345f 100644 (file)
@@ -8018,21 +8018,21 @@ ns_server_validation(ns_server_t *server, char *args, isc_buffer_t **text) {
                        continue;
                result = dns_view_flushcache(view);
                if (result != ISC_R_SUCCESS)
-                       goto out;
+                       goto cleanup;
 
                if (set) {
                        view->enablevalidation = enable;
                        changed = ISC_TRUE;
                } else {
                        if (!first)
-                               putstr(text, "\n");
-                       putstr(text, "DNSSEC validation is ");
-                       putstr(text, view->enablevalidation
-                                      ? "enabled" : "disabled");
-                       putstr(text, " (view ");
-                       putstr(text, view->name);
-                       putstr(text, ")");
-                       putnull(text);
+                               CHECK(putstr(text, "\n"));
+                       CHECK(putstr(text, "DNSSEC validation is "));
+                       CHECK(putstr(text, view->enablevalidation
+                                      ? "enabled" : "disabled"));
+                       CHECK(putstr(text, " (view "));
+                       CHECK(putstr(text, view->name));
+                       CHECK(putstr(text, ")"));
+                       CHECK(putnull(text));
                        first = ISC_FALSE;
                }
        }
@@ -8043,7 +8043,7 @@ ns_server_validation(ns_server_t *server, char *args, isc_buffer_t **text) {
                result = ISC_R_SUCCESS;
        else
                result = ISC_R_FAILURE;
out:
cleanup:
        isc_task_endexclusive(server->task);
        return (result);
 }
@@ -8546,7 +8546,7 @@ list_keynames(dns_view_t *view, dns_tsig_keyring_t *ring, isc_buffer_t **text,
                                dns_name_format(tkey->creator, creatorstr,
                                                sizeof(creatorstr));
                                if (*foundkeys != 0)
-                                       putstr(text, "\n");
+                                       CHECK(putstr(text, "\n"));
                                CHECK(putstr(text, "view \""));
                                CHECK(putstr(text, viewname));
                                CHECK(putstr(text,
@@ -8557,7 +8557,7 @@ list_keynames(dns_view_t *view, dns_tsig_keyring_t *ring, isc_buffer_t **text,
                                CHECK(putstr(text, "\";"));
                        } else {
                                if (*foundkeys != 0)
-                                       putstr(text, "\n");
+                                       CHECK(putstr(text, "\n"));
                                CHECK(putstr(text, "view \""));
                                CHECK(putstr(text, viewname));
                                CHECK(putstr(text,
@@ -8609,12 +8609,15 @@ ns_server_tsiglist(ns_server_t *server, isc_buffer_t **text) {
        isc_task_endexclusive(server->task);
 
        if (foundkeys == 0)
-               putstr(text, "no tsig keys found.");
+               CHECK(putstr(text, "no tsig keys found."));
 
        if (isc_buffer_usedlength(*text) > 0)
-               putnull(text);
+               CHECK(putnull(text));
 
        return (ISC_R_SUCCESS);
+
+ cleanup:
+       return (result);
 }
 
 /*