if (!match_root) {
return (ISC_R_SUCCESS);
}
- if (!root_validation && match_root) {
+
+ if (!root_validation) {
return (ISC_R_SUCCESS);
}
- if (match_root) {
- delv_log(ISC_LOG_DEBUG(3), "adding trust anchor %s",
- trust_anchor);
- }
+ delv_log(ISC_LOG_DEBUG(3), "adding trust anchor %s", trust_anchor);
flags = cfg_obj_asuint32(cfg_tuple_get(key, "flags"));
proto = cfg_obj_asuint32(cfg_tuple_get(key, "protocol"));
looknew->use_usec = false;
looknew->nocrypto = false;
looknew->ttlunits = false;
- looknew->ttlunits = false;
looknew->expandaaaa = false;
looknew->qr = false;
looknew->accept_reply_unexpected_src = false;
result = dns_db_deleterdataset(gdb, node, gversion,
type, covers);
check_result(result, "dns_db_deleterdataset()");
- continue;
}
}
dns_rdatasetiter_destroy(&rdsiter);
outputformat = dns_masterformat_raw;
} else if (strncasecmp(outputformatstr, "raw=", 4) == 0) {
char *end;
- outputformat = dns_masterformat_raw;
outputformat = dns_masterformat_raw;
rawversion = strtol(outputformatstr + 4, &end, 10);
* Read the reply message from named to unclog it. Don't
* bother if there isn't a reply.
*/
- recvfrom(sockfd, buf, 65536, MSG_DONTWAIT, NULL, NULL);
+ (void)recvfrom(sockfd, buf, 65536, MSG_DONTWAIT, NULL, NULL);
while (!ready)
pthread_cond_wait(&cond, &mutex);
* Flush any pending data on the authoritative server.
*/
socklen = sizeof(recvaddr);
- sent = recvfrom(listenfd, rbuf, 65536, MSG_DONTWAIT,
- (struct sockaddr *) &recvaddr, &socklen);
+ (void)recvfrom(listenfd, rbuf, 65536, MSG_DONTWAIT,
+ (struct sockaddr *) &recvaddr, &socklen);
/*
* Send a fixed client query to named(resolver) of
* to the client(query driver), so we're
* done.
*/
- recvfrom(sockfd, buf, 65536, 0, NULL, NULL);
+ (void)recvfrom(sockfd, buf, 65536, 0, NULL,
+ NULL);
break;
}
if (data_cursor != NULL)
data_cursor->c_close(data_cursor);
- if (keyStr != NULL)
- free(keyStr);
+ free(keyStr);
if (tmp != NULL)
free(tmp);
/* if DBI is null, can't do anything else */
if (dbi == NULL) {
- result = ISC_R_FAILURE;
- goto cleanup;
+ return (ISC_R_FAILURE);
}
/* what type of query are we going to run? */
cleanup:
/* it's always good to cleanup after yourself */
- /* if we couldn't even get DBI, just return NULL */
- if (dbi == NULL)
- return ISC_R_FAILURE;
-
/* free dbi->zone string */
if (dbi->zone != NULL)
isc_mem_free(named_g_mctx, dbi->zone);
/*
* Copyright (C) 1999-2001, 2016 Internet Systems Consortium, Inc. ("ISC")
- *
+ *
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
/* if DBI is null, can't do anything else */
if (dbi == NULL) {
- result = ISC_R_FAILURE;
- goto cleanup;
+ return (ISC_R_FAILURE);
}
/* what type of query are we going to run? */
cleanup: /* it's always good to cleanup after yourself */
- /* if we couldn't even allocate DBI, just return NULL */
- if (dbi == NULL)
- return ISC_R_FAILURE;
-
/* free dbi->zone string */
if (dbi->zone != NULL)
isc_mem_free(named_g_mctx, dbi->zone);
/* if DBI is null, can't do anything else */
if (dbi == NULL) {
- result = ISC_R_FAILURE;
- goto cleanup;
+ return (ISC_R_FAILURE);
}
/* what type of query are we going to run? */
"%d cleaning up", dlz_thread_num);
#endif
- /* if we couldn't even allocate DBI, just return NULL */
- if (dbi == NULL)
- return ISC_R_FAILURE;
-
/* free dbi->zone string */
if (dbi->zone != NULL)
isc_mem_free(named_g_mctx, dbi->zone);
if (data_cursor != NULL)
data_cursor->c_close(data_cursor);
- if (keyStr != NULL)
- free(keyStr);
+ free(keyStr);
if (tmp != NULL)
free(tmp);
flag_fail:
/* get rid of what was build of the query list */
- if (tql != NULL)
- destroy_querylist(&tql);
+ destroy_querylist(&tql);
return (result);
}
dir_entry_t *next_de;
basepath = NULL;
- dir_list = NULL;
/* allocate memory for list */
dir_list = malloc(sizeof(dlist_t));
#endif /* PTHREADS */
if (dbi == NULL) {
- result = ISC_R_FAILURE;
- goto cleanup;
+ return (ISC_R_FAILURE);
}
/* what type of query are we going to run? */
result = ISC_R_FAILURE;
cleanup:
- if (dbi == NULL)
- return (ISC_R_FAILURE);
-
if (dbi->zone != NULL) {
free(dbi->zone);
dbi->zone = NULL;
/*
* Copyright (C) 1999-2001, 2013-2014, 2016 Internet Systems Consortium, Inc. ("ISC")
- *
+ *
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
#endif /* PTHREADS */
if (dbi == NULL) {
- result = ISC_R_FAILURE;
- goto cleanup;
+ return (ISC_R_FAILURE);
}
/* what type of query are we going to run? */
result = ISC_R_SUCCESS;
if (query == COUNTZONE) {
sqlite3_free_table(rs->pazResult);
- if (rs == NULL)
- result = ISC_R_FAILURE;
}
- *rsp = rs;
+ if (rsp != NULL) {
+ *rsp = rs;
+ }
cleanup:
- if (dbi == NULL)
- return (ISC_R_FAILURE);
-
if (dbi->zone != NULL) {
free(dbi->zone);
dbi->zone = NULL;
isc_mutex_init(&dnsrps_mutex);
- librpz->set_log(&dnsrps_log_fnc, NULL);
+ librpz->set_log(dnsrps_log_fnc, NULL);
clist = librpz->clist_create(&emsg, dnsrps_lock, dnsrps_unlock,
dnsrps_mutex_destroy, &dnsrps_mutex,
*envp = env;
cleanup:
- if (ffwopt != NULL)
+ if (ffwopt != NULL) {
fstrm_file_options_destroy(&ffwopt);
+ }
- if (fuwopt != NULL)
+ if (fuwopt != NULL) {
fstrm_unix_writer_options_destroy(&fuwopt);
+ }
- if (fwopt != NULL)
+ if (fwopt != NULL) {
fstrm_writer_options_destroy(&fwopt);
+ }
if (result != ISC_R_SUCCESS) {
isc_mutex_destroy(&env->reopen_lock);
*/
fwopt = fstrm_writer_options_init();
if (fwopt == NULL) {
- isc_task_endexclusive(env->reopen_task);
- return (ISC_R_NOMEMORY);
+ CHECK(ISC_R_NOMEMORY);
}
res = fstrm_writer_options_add_content_type(fwopt,
}
cleanup:
- if (ffwopt != NULL)
- fstrm_file_options_destroy(&ffwopt);
-
- if (fw != NULL)
+ if (fw != NULL) {
fstrm_writer_destroy(&fw);
+ }
- if (fwopt != NULL)
- fstrm_writer_options_destroy(&fwopt);
-
- if (fuwopt != NULL)
+ if (fuwopt != NULL) {
fstrm_unix_writer_options_destroy(&fuwopt);
+ }
+
+ if (ffwopt != NULL) {
+ fstrm_file_options_destroy(&ffwopt);
+ }
+
+ if (fwopt != NULL) {
+ fstrm_writer_options_destroy(&fwopt);
+ }
isc_task_endexclusive(env->reopen_task);
ret = dns_rdata_fromstruct(rdata, key->rdclass, dns_rdatatype_ds,
&ds, &b);
end:
- if (md != NULL) {
- isc_md_free(md);
- }
+ isc_md_free(md);
return (ret);
}
} else {
/* cppcheck-suppress unreadVariable */
u.fptr = callback;
- BN_GENCB_set(cb, &progress_cb, u.dptr);
+ BN_GENCB_set(cb, progress_cb, u.dptr);
}
if (!DH_generate_parameters_ex(dh, key->key_size, generator,
ret = ISC_R_SUCCESS;
err:
- if (eckey != NULL)
- EC_KEY_free(eckey);
+ EC_KEY_free(eckey);
return (ret);
}
err:
if (ecdsasig != NULL)
ECDSA_SIG_free(ecdsasig);
- if (eckey != NULL)
- EC_KEY_free(eckey);
+ EC_KEY_free(eckey);
return (ret);
}
ret = ISC_R_SUCCESS;
err:
- if (eckey != NULL)
- EC_KEY_free(eckey);
+ EC_KEY_free(eckey);
return (ret);
}
ret = ISC_R_SUCCESS;
err:
- if (eckey != NULL)
- EC_KEY_free(eckey);
+ EC_KEY_free(eckey);
return (ret);
}
ret = dst__privstruct_writefile(key, &priv, directory);
err:
- if (eckey != NULL)
- EC_KEY_free(eckey);
+ EC_KEY_free(eckey);
if (buf != NULL)
isc_mem_put(key->mctx, buf, BN_num_bytes(privkey));
return (ret);
DST_RET (ISC_R_SUCCESS);
err:
- if (pubeckey != NULL)
- EC_KEY_free(pubeckey);
+ EC_KEY_free(pubeckey);
return (ret);
}
ret = ISC_R_SUCCESS;
err:
- if (ctx != NULL)
- EVP_MD_CTX_free(ctx);
+ EVP_MD_CTX_free(ctx);
isc_buffer_free(&buf);
dctx->ctxdata.generic = NULL;
}
err:
- if (ctx != NULL)
- EVP_MD_CTX_free(ctx);
+ EVP_MD_CTX_free(ctx);
isc_buffer_free(&buf);
dctx->ctxdata.generic = NULL;
ret = ISC_R_SUCCESS;
err:
- if (ctx != NULL)
- EVP_PKEY_CTX_free(ctx);
+ EVP_PKEY_CTX_free(ctx);
return (ret);
}
} else {
/* cppcheck-suppress unreadVariable */
u.fptr = callback;
- BN_GENCB_set(cb, &progress_cb, u.dptr);
+ BN_GENCB_set(cb, progress_cb, u.dptr);
}
if (RSA_generate_key_ex(rsa, key->key_size, e, cb)) {
ret = ISC_R_SUCCESS;
err:
- if (rsa != NULL)
- RSA_free(rsa);
+ RSA_free(rsa);
return (ret);
}
#else
#if defined(_WIN32) || defined(_WIN64)
#include <windows.h>
-static volatile HANDLE _mutex = NULL;
+static volatile void *_mutex = NULL;
/*
* Initialize the mutex on the first lock attempt. On collision, each thread
#define _LOCK() \
do { \
if (!_mutex) { \
- HANDLE p = CreateMutex(NULL, FALSE, NULL); \
+ void *p = CreateMutex(NULL, FALSE, NULL); \
if (InterlockedCompareExchangePointer \
((void **)&_mutex, (void *)p, NULL)) { \
CloseHandle(p); \
static cfg_type_t cfg_type_matchname = {
"optional_matchname", parse_matchname, cfg_print_ustring,
- &doc_matchname, &cfg_rep_tuple, &cfg_type_ustring
+ doc_matchname, &cfg_rep_tuple, &cfg_type_ustring
};
/*%
sizeof(*plugin));
}
- if (handle != NULL) {
- (void) dlclose(handle);
- }
+ (void) dlclose(handle);
}
return (result);
static void
ixfr_rrstream_destroy(rrstream_t **rsp) {
ixfr_rrstream_t *s = (ixfr_rrstream_t *) *rsp;
- if (s->journal != 0)
+ if (s->journal != NULL)
dns_journal_destroy(&s->journal);
isc_mem_putanddetach(&s->common.mctx, s, sizeof(*s));
}