mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-22 10:10:06 +00:00
Apply the SET_IF_NOT_NULL() semantic patch
spatch --sp-file cocci/set_if_not_null.spatch --use-gitgrep --dir "." --include-headers --in-place
This commit is contained in:
parent
0d6dcd217d
commit
c622b349e4
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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:
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user