diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 206c166a6b..bafa54bcd9 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -4543,9 +4543,7 @@ getaddresses(dig_lookup_t *lookup, const char *host, isc_result_t *resultp) { result = isc_getaddresses(host, 0, sockaddrs, DIG_MAX_ADDRESSES, &count); isc_loopmgr_nonblocking(loopmgr); - if (resultp != NULL) { - *resultp = result; - } + SET_IF_NOT_NULL(resultp, result); if (result != ISC_R_SUCCESS) { if (resultp == NULL) { fatal("couldn't get address for '%s': %s", host, diff --git a/bin/dnssec/dnssectool.c b/bin/dnssec/dnssectool.c index 0bf8cc7826..92980a8ca9 100644 --- a/bin/dnssec/dnssectool.c +++ b/bin/dnssec/dnssectool.c @@ -291,15 +291,11 @@ strtotime(const char *str, int64_t now, int64_t base, bool *setp) { struct tm tm; if (isnone(str)) { - if (setp != NULL) { - *setp = false; - } + SET_IF_NOT_NULL(setp, false); return ((isc_stdtime_t)0); } - if (setp != NULL) { - *setp = true; - } + SET_IF_NOT_NULL(setp, true); if ((str[0] == '0' || str[0] == '-') && str[1] == '\0') { return ((isc_stdtime_t)0); diff --git a/bin/named/config.c b/bin/named/config.c index 0f1d3700af..f6242ebe84 100644 --- a/bin/named/config.c +++ b/bin/named/config.c @@ -952,11 +952,7 @@ named_config_getkeyalgorithm(const char *str, unsigned int *typep, } else { bits = algorithms[i].size; } - if (typep != NULL) { - *typep = algorithms[i].type; - } - if (digestbits != NULL) { - *digestbits = bits; - } + SET_IF_NOT_NULL(typep, algorithms[i].type); + SET_IF_NOT_NULL(digestbits, bits); return (ISC_R_SUCCESS); } diff --git a/bin/tests/system/rpz/testlib/dummylib.c b/bin/tests/system/rpz/testlib/dummylib.c index f0e5c50e19..9d63e45687 100644 --- a/bin/tests/system/rpz/testlib/dummylib.c +++ b/bin/tests/system/rpz/testlib/dummylib.c @@ -270,9 +270,7 @@ pack_soa_record(unsigned char *rdatap, size_t rbufsz, size_t *rdlenp, rdatap += 4; used += (4 * 5); - if (rdlenp != NULL) { - *rdlenp = used; - } + SET_IF_NOT_NULL(rdlenp, used); return (true); } @@ -1889,9 +1887,7 @@ domain_pton2(const char *src, u_char *dst, size_t dstsiz, size_t *dstlen, tptr = tmps; - if (dstlen != NULL) { - *dstlen = 0; - } + SET_IF_NOT_NULL(dstlen, 0); while (tptr && *tptr) { tok = strsep(&tptr, "."); @@ -2117,9 +2113,7 @@ trpz_rsp_rr(librpz_emsg_t *emsg, uint16_t *typep, uint16_t *classp, *ttlp = 3600; } - if (typep != NULL) { - *typep = this_rr->type; - } + SET_IF_NOT_NULL(typep, this_rr->type); if (rrp != NULL) { uint8_t *copy_src = NULL, *nrdata = NULL; @@ -2205,9 +2199,7 @@ trpz_rsp_rr(librpz_emsg_t *emsg, uint16_t *typep, uint16_t *classp, trsp->rstack[0].result.next_rr = this_rr->rrn; last_result->rridx++; } else { - if (typep != NULL) { - *typep = ns_t_invalid; - } + SET_IF_NOT_NULL(typep, ns_t_invalid); if (rrp != NULL) { *rrp = NULL; diff --git a/bin/tests/system/rpz/testlib/test-data.c b/bin/tests/system/rpz/testlib/test-data.c index 16f5fbb6fa..d48e216b29 100644 --- a/bin/tests/system/rpz/testlib/test-data.c +++ b/bin/tests/system/rpz/testlib/test-data.c @@ -1114,9 +1114,7 @@ sanity_check_data_file(const char *fname, char **errp) { FILE *f = NULL; int result = -1; - if (errp != NULL) { - *errp = NULL; - } + SET_IF_NOT_NULL(errp, NULL); f = fopen(fname, "r"); if (f == NULL) { diff --git a/lib/dns/adb.c b/lib/dns/adb.c index 7102226bd5..fb99b4cf86 100644 --- a/lib/dns/adb.c +++ b/lib/dns/adb.c @@ -3691,25 +3691,15 @@ dns_adb_getquota(dns_adb_t *adb, uint32_t *quotap, uint32_t *freqp, double *lowp, double *highp, double *discountp) { REQUIRE(DNS_ADB_VALID(adb)); - if (quotap != NULL) { - *quotap = adb->quota; - } + SET_IF_NOT_NULL(quotap, adb->quota); - if (freqp != NULL) { - *freqp = adb->atr_freq; - } + SET_IF_NOT_NULL(freqp, adb->atr_freq); - if (lowp != NULL) { - *lowp = adb->atr_low; - } + SET_IF_NOT_NULL(lowp, adb->atr_low); - if (highp != NULL) { - *highp = adb->atr_high; - } + SET_IF_NOT_NULL(highp, adb->atr_high); - if (discountp != NULL) { - *discountp = adb->atr_discount; - } + SET_IF_NOT_NULL(discountp, adb->atr_discount); } static bool diff --git a/lib/dns/key.c b/lib/dns/key.c index d039ea4444..2449e8aac1 100644 --- a/lib/dns/key.c +++ b/lib/dns/key.c @@ -212,12 +212,8 @@ dst_key_have_ksk_and_zsk(dst_key_t **keys, unsigned int nkeys, unsigned int i, } } - if (have_ksk != NULL) { - *have_ksk = hksk; - } - if (have_zsk != NULL) { - *have_zsk = hzsk; - } + SET_IF_NOT_NULL(have_ksk, hksk); + SET_IF_NOT_NULL(have_zsk, hzsk); return (hksk && hzsk); } diff --git a/lib/dns/message.c b/lib/dns/message.c index a86724a074..6477253352 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -2633,12 +2633,8 @@ dns_message_peekheader(isc_buffer_t *source, dns_messageid_t *idp, flags = isc_buffer_getuint16(&buffer); flags &= DNS_MESSAGE_FLAG_MASK; - if (flagsp != NULL) { - *flagsp = flags; - } - if (idp != NULL) { - *idp = id; - } + SET_IF_NOT_NULL(flagsp, flags); + SET_IF_NOT_NULL(idp, id); return (ISC_R_SUCCESS); } @@ -2786,9 +2782,7 @@ dns_message_gettsig(dns_message_t *msg, const dns_name_t **owner) { REQUIRE(DNS_MESSAGE_VALID(msg)); REQUIRE(owner == NULL || *owner == NULL); - if (owner != NULL) { - *owner = msg->tsigname; - } + SET_IF_NOT_NULL(owner, msg->tsigname); return (msg->tsig); } diff --git a/lib/dns/nsec3.c b/lib/dns/nsec3.c index 95454df9de..227ac5c129 100644 --- a/lib/dns/nsec3.c +++ b/lib/dns/nsec3.c @@ -271,9 +271,7 @@ dns_nsec3_hashname(dns_fixedname_t *result, return (DNS_R_BADALG); } - if (hash_length != NULL) { - *hash_length = len; - } + SET_IF_NOT_NULL(hash_length, len); /* convert the hash to base32hex non-padded */ region.base = rethash; diff --git a/lib/dns/openssl_shim.c b/lib/dns/openssl_shim.c index 15e93b61ba..128ffd3eb1 100644 --- a/lib/dns/openssl_shim.c +++ b/lib/dns/openssl_shim.c @@ -98,39 +98,23 @@ RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp) { void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) { - if (n != NULL) { - *n = r->n; - } - if (e != NULL) { - *e = r->e; - } - if (d != NULL) { - *d = r->d; - } + SET_IF_NOT_NULL(n, r->n); + SET_IF_NOT_NULL(e, r->e); + SET_IF_NOT_NULL(d, r->d); } void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q) { - if (p != NULL) { - *p = r->p; - } - if (q != NULL) { - *q = r->q; - } + SET_IF_NOT_NULL(p, r->p); + SET_IF_NOT_NULL(q, r->q); } void RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, const BIGNUM **iqmp) { - if (dmp1 != NULL) { - *dmp1 = r->dmp1; - } - if (dmq1 != NULL) { - *dmq1 = r->dmq1; - } - if (iqmp != NULL) { - *iqmp = r->iqmp; - } + SET_IF_NOT_NULL(dmp1, r->dmp1); + SET_IF_NOT_NULL(dmq1, r->dmq1); + SET_IF_NOT_NULL(iqmp, r->iqmp); } int @@ -143,12 +127,8 @@ RSA_test_flags(const RSA *r, int flags) { /* From OpenSSL 1.1 */ void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps) { - if (pr != NULL) { - *pr = sig->r; - } - if (ps != NULL) { - *ps = sig->s; - } + SET_IF_NOT_NULL(pr, sig->r); + SET_IF_NOT_NULL(ps, sig->s); } int @@ -172,9 +152,7 @@ static const char err_empty_string = '\0'; unsigned long ERR_get_error_all(const char **file, int *line, const char **func, const char **data, int *flags) { - if (func != NULL) { - *func = &err_empty_string; - } + SET_IF_NOT_NULL(func, &err_empty_string); return (ERR_get_error_line_data(file, line, data, flags)); } #endif /* if !HAVE_ERR_GET_ERROR_ALL */ diff --git a/lib/dns/rbt-zonedb.c b/lib/dns/rbt-zonedb.c index 1bcb85979f..8c87191114 100644 --- a/lib/dns/rbt-zonedb.c +++ b/lib/dns/rbt-zonedb.c @@ -1956,13 +1956,9 @@ getsize(dns_db_t *db, dns_dbversion_t *version, uint64_t *records, } RWLOCK(&rbtversion->rwlock, isc_rwlocktype_read); - if (records != NULL) { - *records = rbtversion->records; - } + SET_IF_NOT_NULL(records, rbtversion->records); - if (xfrsize != NULL) { - *xfrsize = rbtversion->xfrsize; - } + SET_IF_NOT_NULL(xfrsize, rbtversion->xfrsize); RWUNLOCK(&rbtversion->rwlock, isc_rwlocktype_read); RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read); diff --git a/lib/dns/rdata/in_1/svcb_64.c b/lib/dns/rdata/in_1/svcb_64.c index d88cfb7b50..545dd52bf9 100644 --- a/lib/dns/rdata/in_1/svcb_64.c +++ b/lib/dns/rdata/in_1/svcb_64.c @@ -247,9 +247,7 @@ finish: isc_textregion_consume(region, 1); } RETERR(uint16_tobuffer(ul, target)); - if (value != NULL) { - *value = ul; - } + SET_IF_NOT_NULL(value, ul); return (ISC_R_SUCCESS); } diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 0af07b8273..fdc4c3437d 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -6854,9 +6854,7 @@ is_answertarget_allowed(fetchctx_t *fctx, dns_name_t *qname, dns_name_t *rname, result = dns_name_concatenate(&prefix, &dname.dname, tname, NULL); if (result == DNS_R_NAMETOOLONG) { - if (chainingp != NULL) { - *chainingp = true; - } + SET_IF_NOT_NULL(chainingp, true); return (true); } RUNTIME_CHECK(result == ISC_R_SUCCESS); @@ -6865,9 +6863,7 @@ is_answertarget_allowed(fetchctx_t *fctx, dns_name_t *qname, dns_name_t *rname, UNREACHABLE(); } - if (chainingp != NULL) { - *chainingp = true; - } + SET_IF_NOT_NULL(chainingp, true); if (view->denyanswernames == NULL) { return (true); @@ -11014,15 +11010,9 @@ dns_resolver_getclientsperquery(dns_resolver_t *resolver, uint32_t *cur, REQUIRE(VALID_RESOLVER(resolver)); LOCK(&resolver->lock); - if (cur != NULL) { - *cur = resolver->spillat; - } - if (min != NULL) { - *min = resolver->spillatmin; - } - if (max != NULL) { - *max = resolver->spillatmax; - } + SET_IF_NOT_NULL(cur, resolver->spillat); + SET_IF_NOT_NULL(min, resolver->spillatmin); + SET_IF_NOT_NULL(max, resolver->spillatmax); UNLOCK(&resolver->lock); } diff --git a/lib/dns/rriterator.c b/lib/dns/rriterator.c index 93548bce4d..49bcd67ebf 100644 --- a/lib/dns/rriterator.c +++ b/lib/dns/rriterator.c @@ -210,11 +210,7 @@ dns_rriterator_current(dns_rriterator_t *it, dns_name_t **name, uint32_t *ttl, dns_rdata_reset(&it->rdata); dns_rdataset_current(&it->rdataset, &it->rdata); - if (rdataset != NULL) { - *rdataset = &it->rdataset; - } + SET_IF_NOT_NULL(rdataset, &it->rdataset); - if (rdata != NULL) { - *rdata = &it->rdata; - } + SET_IF_NOT_NULL(rdata, &it->rdata); } diff --git a/lib/dns/tsig.c b/lib/dns/tsig.c index 78e7328335..fbefeb3ba4 100644 --- a/lib/dns/tsig.c +++ b/lib/dns/tsig.c @@ -290,9 +290,7 @@ dns_tsigkey_createfromkey(const dns_name_t *name, dst_algorithm_t algorithm, tsig_log(tkey, ISC_LOG_DEBUG(3), "statically configured"); } - if (keyp != NULL) { - *keyp = tkey; - } + SET_IF_NOT_NULL(keyp, tkey); return (ISC_R_SUCCESS); cleanup_name: diff --git a/lib/dns/update.c b/lib/dns/update.c index 6d7e563c0f..4cfc8142b0 100644 --- a/lib/dns/update.c +++ b/lib/dns/update.c @@ -851,9 +851,7 @@ is_active(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name, bool *flag, if (result == ISC_R_SUCCESS || result == DNS_R_EMPTYNAME) { *flag = true; *cut = false; - if (unsecure != NULL) { - *unsecure = false; - } + SET_IF_NOT_NULL(unsecure, false); return (ISC_R_SUCCESS); } else if (result == DNS_R_ZONECUT) { *flag = true; @@ -879,9 +877,7 @@ is_active(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name, bool *flag, { *flag = false; *cut = false; - if (unsecure != NULL) { - *unsecure = false; - } + SET_IF_NOT_NULL(unsecure, false); return (ISC_R_SUCCESS); } else { /* @@ -889,9 +885,7 @@ is_active(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name, bool *flag, */ *flag = false; *cut = false; - if (unsecure != NULL) { - *unsecure = false; - } + SET_IF_NOT_NULL(unsecure, false); return (result); } } @@ -2231,9 +2225,7 @@ dns_update_soaserial(uint32_t serial, dns_updatemethod_t method, UNREACHABLE(); } - if (used != NULL) { - *used = method; - } + SET_IF_NOT_NULL(used, method); return (new_serial); } diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 21a906813b..a99817294d 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -125,7 +125,7 @@ */ #define RANGE(a, min, max) (((a) < (min)) ? (min) : ((a) < (max) ? (a) : (max))) -#define NSEC3REMOVE(x) (((x) & DNS_NSEC3FLAG_REMOVE) != 0) +#define NSEC3REMOVE(x) (((x)&DNS_NSEC3FLAG_REMOVE) != 0) /*% * Key flags @@ -5459,12 +5459,8 @@ zone_count_ns_rr(dns_zone_t *zone, dns_db_t *db, dns_dbnode_t *node, dns_rdataset_disassociate(&rdataset); success: - if (nscount != NULL) { - *nscount = count; - } - if (errors != NULL) { - *errors = ecount; - } + SET_IF_NOT_NULL(nscount, count); + SET_IF_NOT_NULL(errors, ecount); result = ISC_R_SUCCESS; diff --git a/lib/dns/zt.c b/lib/dns/zt.c index 01bed3c290..76eea010c0 100644 --- a/lib/dns/zt.c +++ b/lib/dns/zt.c @@ -527,9 +527,7 @@ dns_zt_apply(dns_zt_t *zt, bool stop, isc_result_t *sub, } dns_qpread_destroy(zt->multi, &qpr); - if (sub != NULL) { - *sub = tresult; - } + SET_IF_NOT_NULL(sub, tresult); return (result); } diff --git a/lib/isc/hashmap.c b/lib/isc/hashmap.c index d5d8eb13bb..12c1822b9b 100644 --- a/lib/isc/hashmap.c +++ b/lib/isc/hashmap.c @@ -347,9 +347,7 @@ isc_hashmap_find(const isc_hashmap_t *hashmap, const uint32_t *hashvalp, } INSIST(node->key != NULL); - if (valuep != NULL) { - *valuep = node->value; - } + SET_IF_NOT_NULL(valuep, node->value); return (ISC_R_SUCCESS); } diff --git a/lib/isc/ht.c b/lib/isc/ht.c index 4d771882dd..6f2ff5e60a 100644 --- a/lib/isc/ht.c +++ b/lib/isc/ht.c @@ -372,9 +372,7 @@ isc_ht_find(const isc_ht_t *ht, const unsigned char *key, return (ISC_R_NOTFOUND); } - if (valuep != NULL) { - *valuep = node->value; - } + SET_IF_NOT_NULL(valuep, node->value); return (ISC_R_SUCCESS); } diff --git a/lib/isc/include/isc/buffer.h b/lib/isc/include/isc/buffer.h index 4e73c9c7c5..18f671deb9 100644 --- a/lib/isc/include/isc/buffer.h +++ b/lib/isc/include/isc/buffer.h @@ -844,9 +844,7 @@ isc_buffer_peekuint8(const isc_buffer_t *restrict b, uint8_t *valp) { ISC_BUFFER_PEEK_CHECK(b, sizeof(*valp)); uint8_t *cp = isc_buffer_current(b); - if (valp != NULL) { - *valp = (uint8_t)(cp[0]); - } + SET_IF_NOT_NULL(valp, (uint8_t)(cp[0])); return (ISC_R_SUCCESS); } @@ -887,9 +885,7 @@ isc_buffer_peekuint16(const isc_buffer_t *restrict b, uint16_t *valp) { uint8_t *cp = isc_buffer_current(b); - if (valp != NULL) { - *valp = ISC_U8TO16_BE(cp); - } + SET_IF_NOT_NULL(valp, ISC_U8TO16_BE(cp)); return (ISC_R_SUCCESS); } @@ -917,9 +913,7 @@ isc_buffer_peekuint32(const isc_buffer_t *restrict b, uint32_t *valp) { uint8_t *cp = isc_buffer_current(b); - if (valp != NULL) { - *valp = ISC_U8TO32_BE(cp); - } + SET_IF_NOT_NULL(valp, ISC_U8TO32_BE(cp)); return (ISC_R_SUCCESS); } @@ -948,9 +942,7 @@ isc_buffer_peekuint48(const isc_buffer_t *restrict b, uint64_t *valp) { uint8_t *cp = isc_buffer_current(b); - if (valp != NULL) { - *valp = ISC_U8TO48_BE(cp); - } + SET_IF_NOT_NULL(valp, ISC_U8TO48_BE(cp)); return (ISC_R_SUCCESS); } diff --git a/lib/isc/log.c b/lib/isc/log.c index 51369af4c0..f923a16e61 100644 --- a/lib/isc/log.c +++ b/lib/isc/log.c @@ -288,9 +288,7 @@ isc_log_create(isc_mem_t *mctx, isc_log_t **lctxp, isc_logconfig_t **lcfgp) { atomic_init(&lctx->dynamic, lcfg->dynamic); *lctxp = lctx; - if (lcfgp != NULL) { - *lcfgp = lcfg; - } + SET_IF_NOT_NULL(lcfgp, lcfg); } void diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index c861751555..0f1ab466a7 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -384,21 +384,13 @@ isc_nm_gettimeouts(isc_nm_t *mgr, uint32_t *initial, uint32_t *idle, uint32_t *keepalive, uint32_t *advertised) { REQUIRE(VALID_NM(mgr)); - if (initial != NULL) { - *initial = atomic_load_relaxed(&mgr->init); - } + SET_IF_NOT_NULL(initial, atomic_load_relaxed(&mgr->init)); - if (idle != NULL) { - *idle = atomic_load_relaxed(&mgr->idle); - } + SET_IF_NOT_NULL(idle, atomic_load_relaxed(&mgr->idle)); - if (keepalive != NULL) { - *keepalive = atomic_load_relaxed(&mgr->keepalive); - } + SET_IF_NOT_NULL(keepalive, atomic_load_relaxed(&mgr->keepalive)); - if (advertised != NULL) { - *advertised = atomic_load_relaxed(&mgr->advertised); - } + SET_IF_NOT_NULL(advertised, atomic_load_relaxed(&mgr->advertised)); } bool diff --git a/lib/isc/stdio.c b/lib/isc/stdio.c index ad987c66d5..601dcc1758 100644 --- a/lib/isc/stdio.c +++ b/lib/isc/stdio.c @@ -85,9 +85,7 @@ isc_stdio_read(void *ptr, size_t size, size_t nmemb, FILE *f, size_t *nret) { result = isc__errno2result(errno); } } - if (nret != NULL) { - *nret = r; - } + SET_IF_NOT_NULL(nret, r); return (result); } @@ -102,9 +100,7 @@ isc_stdio_write(const void *ptr, size_t size, size_t nmemb, FILE *f, if (r != nmemb) { result = isc__errno2result(errno); } - if (nret != NULL) { - *nret = r; - } + SET_IF_NOT_NULL(nret, r); return (result); } diff --git a/lib/isc/symtab.c b/lib/isc/symtab.c index c4cbcabbbe..f8028a2ca5 100644 --- a/lib/isc/symtab.c +++ b/lib/isc/symtab.c @@ -161,9 +161,7 @@ isc_symtab_lookup(isc_symtab_t *symtab, const char *key, unsigned int type, return (ISC_R_NOTFOUND); } - if (value != NULL) { - *value = elt->value; - } + SET_IF_NOT_NULL(value, elt->value); return (ISC_R_SUCCESS); } diff --git a/lib/isccc/symtab.c b/lib/isccc/symtab.c index 9260c211bb..15ab4fc2ca 100644 --- a/lib/isccc/symtab.c +++ b/lib/isccc/symtab.c @@ -198,9 +198,7 @@ isccc_symtab_lookup(isccc_symtab_t *symtab, const char *key, unsigned int type, return (ISC_R_NOTFOUND); } - if (value != NULL) { - *value = elt->value; - } + SET_IF_NOT_NULL(value, elt->value); return (ISC_R_SUCCESS); } diff --git a/lib/isccfg/check.c b/lib/isccfg/check.c index 44be487daa..2098030283 100644 --- a/lib/isccfg/check.c +++ b/lib/isccfg/check.c @@ -1144,9 +1144,7 @@ check_port(const cfg_obj_t *options, isc_log_t *logctx, const char *type, return (ISC_R_RANGE); } - if (portp != NULL) { - *portp = (in_port_t)cfg_obj_asuint32(portobj); - } + SET_IF_NOT_NULL(portp, (in_port_t)cfg_obj_asuint32(portobj)); return (ISC_R_SUCCESS); } diff --git a/lib/ns/query.c b/lib/ns/query.c index 9d4ba5c13c..1212ed16e1 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -1092,9 +1092,7 @@ query_validatezonedb(ns_client_t *client, const dns_name_t *name, approved: /* Transfer ownership, if necessary. */ - if (versionp != NULL) { - *versionp = dbversion->version; - } + SET_IF_NOT_NULL(versionp, dbversion->version); return (ISC_R_SUCCESS); } @@ -1495,9 +1493,7 @@ query_isduplicate(ns_client_t *client, dns_name_t *name, dns_rdatatype_t type, mname = NULL; } - if (mnamep != NULL) { - *mnamep = mname; - } + SET_IF_NOT_NULL(mnamep, mname); CTRACE(ISC_LOG_DEBUG(3), "query_isduplicate: false: done"); return (false);