]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
silence coverity warnings
authorEvan Hunt <each@isc.org>
Mon, 3 Apr 2023 19:18:11 +0000 (12:18 -0700)
committerOndřej Surý <ondrej@isc.org>
Wed, 5 Apr 2023 07:23:51 +0000 (09:23 +0200)
silence coverity warnings in the DNSPRS code:
- CID 451097, failure to check return value of rpz_ready()
- CID 451099, resource leak

lib/dns/include/dns/librpz.h
lib/ns/query.c

index 87d189afb853fb603f0bc6b5a1cd87e8d135773f..e971ab027d425c4398058d5c8d399b054e5aef9a 100644 (file)
@@ -887,6 +887,7 @@ librpz_lib_open(librpz_emsg_t *emsg, void **dl_handle, const char *path) {
                if (new_librpz != NULL) {
                        if (dl_handle != NULL) {
                                *dl_handle = handle;
+                               handle = NULL;
                        }
                        return (new_librpz);
                }
@@ -914,6 +915,7 @@ librpz_lib_open(librpz_emsg_t *emsg, void **dl_handle, const char *path) {
        if (new_librpz != NULL) {
                if (dl_handle != NULL) {
                        *dl_handle = handle;
+                       handle = NULL;
                }
                return (new_librpz);
        }
index d82a96995b3a151da55c1192c4f5ab8ecc46b545..a5fb82169aacec0bd66fb9b36e72aa0cd64dff78 100644 (file)
@@ -3439,7 +3439,10 @@ dnsrps_set_p(librpz_emsg_t *emsg, ns_client_t *client, dns_rpz_st_t *st,
        region.length = pname_buf.size;
        dns_name_fromregion(st->p_name, &region);
 
-       rpz_ready(client, p_rdatasetp);
+       result = rpz_ready(client, p_rdatasetp);
+       if (result != ISC_R_SUCCESS) {
+               return (false);
+       }
        dns_db_attach(st->rpsdb, &p_db);
        policy = dns_dnsrps_2policy(rpsdb->result.policy);
        if (policy != DNS_RPZ_POLICY_RECORD) {