Commit 36c6105e authored by Ondřej Surý's avatar Ondřej Surý

Use coccinelle to add braces to nested single line statement

Both clang-tidy and uncrustify chokes on statement like this:

for (...)
	if (...)
		break;

This commit uses a very simple semantic patch (below) to add braces around such
statements.

Semantic patch used:

@@
statement S;
expression E;
@@

while (...)
- if (E) S
+ { if (E) { S } }

@@
statement S;
expression E;
@@

for (...;...;...)
- if (E) S
+ { if (E) { S } }

@@
statement S;
expression E;
@@

if (...)
- if (E) S
+ { if (E) { S } }
parent c823ed4f
......@@ -692,9 +692,11 @@ resume:
listcount = newlen;
}
/* Seen? */
for (j = 0; j < l; j++)
if (strcasecmp(lists[j].name, listname) == 0)
for (j = 0; j < l; j++) {
if (strcasecmp(lists[j].name, listname) == 0) {
break;
}
}
if (j < l)
continue;
tresult = named_config_getmastersdef(config, listname,
......
......@@ -945,10 +945,13 @@ update_listener(named_controls_t *cp, controllistener_t **listenerp,
isc_result_t result = ISC_R_SUCCESS;
for (listener = ISC_LIST_HEAD(cp->listeners); listener != NULL;
listener = ISC_LIST_NEXT(listener, link))
if (isc_sockaddr_equal(addr, &listener->address))
listener = ISC_LIST_NEXT(listener, link)) {
if (isc_sockaddr_equal(addr, &listener->address)) {
break;
}
}
if (listener == NULL) {
*listenerp = NULL;
return;
......
......@@ -1744,10 +1744,16 @@ check_dbtype(dns_zone_t *zone, unsigned int dbtypec, const char **dbargv,
/*
* Check that all the arguments match.
*/
for (i = 0; i < dbtypec; i++)
if (argv[i] == NULL || strcmp(argv[i], dbargv[i]) != 0)
for (i = 0; i < dbtypec; i++) {
if (argv[i] == NULL || strcmp(argv[i], dbargv[i]) != 0) {
CHECK(ISC_R_FAILURE);
/*
* Check that there are not extra arguments.
*/
}
}
/*
* Check that there are not extra arguments.
*/
......@@ -10525,10 +10531,13 @@ add_view_tolist(struct dumpcontext *dctx, dns_view_t *view)
* Prevent duplicate views.
*/
for (vle = ISC_LIST_HEAD(dctx->viewlist); vle != NULL;
vle = ISC_LIST_NEXT(vle, link))
if (vle->view == view)
vle = ISC_LIST_NEXT(vle, link)) {
if (vle->view == view) {
return (ISC_R_SUCCESS);
}
}
vle = isc_mem_get(dctx->mctx, sizeof *vle);
vle->view = NULL;
dns_view_attach(view, &vle->view);
......
......@@ -3660,10 +3660,13 @@ update_listener(named_server_t *server, named_statschannel_t **listenerp,
isc_result_t result = ISC_R_SUCCESS;
for (listener = ISC_LIST_HEAD(server->statschannels); listener != NULL;
listener = ISC_LIST_NEXT(listener, link))
if (isc_sockaddr_equal(addr, &listener->address))
listener = ISC_LIST_NEXT(listener, link)) {
if (isc_sockaddr_equal(addr, &listener->address)) {
break;
}
}
if (listener == NULL) {
*listenerp = NULL;
return;
......
......@@ -468,10 +468,12 @@ main(int argc, char *argv[])
if (verbose && dbi != NULL) {
if (dbi->wversion != NULL)
printf("future version (%p)\n", dbi->wversion);
for (i = 0; i < dbi->rcount; i++)
if (dbi->rversions[i] != NULL)
for (i = 0; i < dbi->rcount; i++) {
if (dbi->rversions[i] != NULL) {
printf("open version %d (%p)\n", i,
dbi->rversions[i]);
}
}
}
dns_name_init(&name, offsets);
if (strcmp(s, "!R") == 0) {
......
......@@ -679,14 +679,16 @@ odbc_getManyFields(SQLHSTMT *stmnt, SQLSMALLINT startField,
REQUIRE(startField > 0 && startField <= endField);
/* determine how large the data is */
for (i = startField; i <= endField; i++)
if (sqlOK(SQLColAttribute(stmnt, i, SQL_DESC_DISPLAY_SIZE, NULL,
0, NULL, &size)) &&
size > 0) {
for (i = startField; i <= endField; i++) {
if (sqlOK(SQLColAttribute(stmnt, i, SQL_DESC_DISPLAY_SIZE, NULL, 0, NULL, &size)) && size > 0) {
{
/* always allow for a " " (space) character */
totSize += (size + 1);
totSize += (size + 1);
/* after the data item */
}
}
}
if (totSize < 1)
return ISC_R_FAILURE;
......
......@@ -383,9 +383,11 @@ mysql_get_resultset(const char *zone, const char *record, const char *client,
qres = mysql_query((MYSQL *)dbi->dbconn, querystring);
if (qres == 0)
break;
for (j = 0; j < 4; j++)
if (mysql_ping((MYSQL *)dbi->dbconn) == 0)
for (j = 0; j < 4; j++) {
if (mysql_ping((MYSQL *)dbi->dbconn) == 0) {
break;
}
}
}
if (qres == 0) {
......
......@@ -437,10 +437,13 @@ build_query(mysql_data_t *state, mysql_instance_t *dbi, const char *command,
*query = '\0';
for (item = DLZ_LIST_HEAD(arglist); item != NULL;
item = DLZ_LIST_NEXT(item, link))
if (item->arg != NULL)
item = DLZ_LIST_NEXT(item, link)) {
if (item->arg != NULL) {
strcat(query, item->arg);
}
}
fail:
va_end(ap1);
......
......@@ -4478,10 +4478,18 @@ bind9_check_namedconf(const cfg_obj_t *config, bool check_plugins,
(void)cfg_map_get(config, "view", &views);
if (views != NULL && options != NULL)
if (check_dual_stack(options, logctx) != ISC_R_SUCCESS)
if (views != NULL && options != NULL) {
if (check_dual_stack(options, logctx) != ISC_R_SUCCESS) {
result = ISC_R_FAILURE;
/*
* Use case insensitive comparision as not all file systems are
* case sensitive. This will prevent people using FOO.DB and foo.db
* on case sensitive file systems but that shouldn't be a major issue.
*/
}
}
/*
* Use case insensitive comparision as not all file systems are
* case sensitive. This will prevent people using FOO.DB and foo.db
......@@ -4622,15 +4630,20 @@ bind9_check_namedconf(const cfg_obj_t *config, bool check_plugins,
aclname = cfg_obj_asstring(cfg_tuple_get(acl, "name"));
for (i = 0; i < sizeof(builtin) / sizeof(builtin[0]);
i++)
i++) {
if (strcasecmp(aclname, builtin[i]) == 0) {
cfg_obj_log(acl, logctx, ISC_LOG_ERROR,
"attempt to redefine "
"builtin acl '%s'",
aclname);
result = ISC_R_FAILURE;
break;
{
cfg_obj_log(acl, logctx,
ISC_LOG_ERROR,
"attempt to redefine "
"builtin acl '%s'",
aclname);
result = ISC_R_FAILURE;
break;
}
}
}
for (elt2 = cfg_list_next(elt); elt2 != NULL;
elt2 = cfg_list_next(elt2)) {
......
......@@ -610,10 +610,16 @@ grow_entries(isc_task_t *task, isc_event_t *ev)
/*
* Are we shutting down?
*/
for (i = 0; i < adb->nentries; i++)
if (adb->entry_sd[i])
for (i = 0; i < adb->nentries; i++) {
if (adb->entry_sd[i]) {
goto cleanup;
/*
* Grab all the resources we need.
*/
}
}
/*
* Grab all the resources we need.
*/
......@@ -764,10 +770,16 @@ grow_names(isc_task_t *task, isc_event_t *ev)
/*
* Are we shutting down?
*/
for (i = 0; i < adb->nnames; i++)
if (adb->name_sd[i])
for (i = 0; i < adb->nnames; i++) {
if (adb->name_sd[i]) {
goto cleanup;
/*
* Grab all the resources we need.
*/
}
}
/*
* Grab all the resources we need.
*/
......@@ -963,9 +975,11 @@ import_rdataset(dns_adbname_t *adbname, dns_rdataset_t *rdataset,
link_entry(adb, addr_bucket, entry);
} else {
for (anh = ISC_LIST_HEAD(*hookhead); anh != NULL;
anh = ISC_LIST_NEXT(anh, plink))
if (anh->entry == foundentry)
anh = ISC_LIST_NEXT(anh, plink)) {
if (anh->entry == foundentry) {
break;
}
}
if (anh == NULL) {
foundentry->refcnt++;
foundentry->nh++;
......
......@@ -291,9 +291,11 @@ dns_cache_create(isc_mem_t *cmctx, isc_mem_t *hmctx, isc_taskmgr_t *taskmgr,
cleanup_db:
dns_db_detach(&cache->db);
cleanup_dbargv:
for (i = extra; i < cache->db_argc; i++)
if (cache->db_argv[i] != NULL)
for (i = extra; i < cache->db_argc; i++) {
if (cache->db_argv[i] != NULL) {
isc_mem_free(cmctx, cache->db_argv[i]);
}
}
if (cache->db_argv != NULL)
isc_mem_put(cmctx, cache->db_argv,
cache->db_argc * sizeof(char *));
......
......@@ -85,9 +85,11 @@ impfind(const char *name)
dns_dbimplementation_t *imp;
for (imp = ISC_LIST_HEAD(implementations); imp != NULL;
imp = ISC_LIST_NEXT(imp, link))
if (strcasecmp(name, imp->name) == 0)
imp = ISC_LIST_NEXT(imp, link)) {
if (strcasecmp(name, imp->name) == 0) {
return (imp);
}
}
return (NULL);
}
......
......@@ -93,9 +93,11 @@ dlz_impfind(const char *name)
dns_dlzimplementation_t *imp;
for (imp = ISC_LIST_HEAD(dlz_implementations); imp != NULL;
imp = ISC_LIST_NEXT(imp, link))
if (strcasecmp(name, imp->name) == 0)
imp = ISC_LIST_NEXT(imp, link)) {
if (strcasecmp(name, imp->name) == 0) {
return (imp);
}
}
return (NULL);
}
......
......@@ -1406,10 +1406,18 @@ dns_dnssec_findmatchingkeys(const dns_name_t *origin, const char *directory,
dir.entry.name[i] != '+')
continue;
for (i++; i < dir.entry.length; i++)
if (dir.entry.name[i] < '0' || dir.entry.name[i] > '9')
for (i++; i < dir.entry.length; i++) {
if (dir.entry.name[i] < '0' || dir.entry.name[i] > '9') {
break;
/*
* Did we not read exactly 5 more digits?
* Did we overflow?
* Did we correctly terminate?
*/
}
}
/*
* Did we not read exactly 5 more digits?
* Did we overflow?
......
......@@ -257,9 +257,11 @@ dst_lib_destroy(void)
RUNTIME_CHECK(dst_initialized == true);
dst_initialized = false;
for (i = 0; i < DST_MAX_ALGS; i++)
if (dst_t_func[i] != NULL && dst_t_func[i]->cleanup != NULL)
for (i = 0; i < DST_MAX_ALGS; i++) {
if (dst_t_func[i] != NULL && dst_t_func[i]->cleanup != NULL) {
dst_t_func[i]->cleanup();
}
}
dst__openssl_destroy();
#if USE_PKCS11
(void)dst__pkcs11_destroy();
......
......@@ -181,9 +181,11 @@ check_rsa(const dst_private_t *priv, bool external)
have[i] = false;
for (j = 0; j < priv->nelements; j++) {
for (i = 0; i < RSA_NTAGS; i++)
if (priv->elements[j].tag == TAG(DST_ALG_RSA, i))
for (i = 0; i < RSA_NTAGS; i++) {
if (priv->elements[j].tag == TAG(DST_ALG_RSA, i)) {
break;
}
}
if (i == RSA_NTAGS)
return (-1);
have[i] = true;
......@@ -214,9 +216,11 @@ check_dh(const dst_private_t *priv)
if (priv->nelements != DH_NTAGS)
return (-1);
for (i = 0; i < DH_NTAGS; i++) {
for (j = 0; j < priv->nelements; j++)
if (priv->elements[j].tag == TAG(DST_ALG_DH, i))
for (j = 0; j < priv->nelements; j++) {
if (priv->elements[j].tag == TAG(DST_ALG_DH, i)) {
break;
}
}
if (j == priv->nelements)
return (-1);
}
......@@ -237,9 +241,11 @@ check_ecdsa(const dst_private_t *priv, bool external)
for (i = 0; i < ECDSA_NTAGS; i++)
have[i] = false;
for (j = 0; j < priv->nelements; j++) {
for (i = 0; i < ECDSA_NTAGS; i++)
if (priv->elements[j].tag == TAG(DST_ALG_ECDSA256, i))
for (i = 0; i < ECDSA_NTAGS; i++) {
if (priv->elements[j].tag == TAG(DST_ALG_ECDSA256, i)) {
break;
}
}
if (i == ECDSA_NTAGS)
return (-1);
have[i] = true;
......@@ -268,9 +274,11 @@ check_eddsa(const dst_private_t *priv, bool external)
for (i = 0; i < EDDSA_NTAGS; i++)
have[i] = false;
for (j = 0; j < priv->nelements; j++) {
for (i = 0; i < EDDSA_NTAGS; i++)
if (priv->elements[j].tag == TAG(DST_ALG_ED25519, i))
for (i = 0; i < EDDSA_NTAGS; i++) {
if (priv->elements[j].tag == TAG(DST_ALG_ED25519, i)) {
break;
}
}
if (i == EDDSA_NTAGS)
return (-1);
have[i] = true;
......@@ -304,9 +312,11 @@ check_hmac_md5(const dst_private_t *priv, bool old)
* We must be new format at this point.
*/
for (i = 0; i < HMACMD5_NTAGS; i++) {
for (j = 0; j < priv->nelements; j++)
if (priv->elements[j].tag == TAG(DST_ALG_HMACMD5, i))
for (j = 0; j < priv->nelements; j++) {
if (priv->elements[j].tag == TAG(DST_ALG_HMACMD5, i)) {
break;
}
}
if (j == priv->nelements)
return (-1);
}
......@@ -320,9 +330,11 @@ check_hmac_sha(const dst_private_t *priv, unsigned int ntags, unsigned int alg)
if (priv->nelements != ntags)
return (-1);
for (i = 0; i < ntags; i++) {
for (j = 0; j < priv->nelements; j++)
if (priv->elements[j].tag == TAG(alg, i))
for (j = 0; j < priv->nelements; j++) {
if (priv->elements[j].tag == TAG(alg, i)) {
break;
}
}
if (j == priv->nelements)
return (-1);
}
......
......@@ -76,9 +76,11 @@ impfind(const char *name)
dyndb_implementation_t *imp;
for (imp = ISC_LIST_HEAD(dyndb_implementations); imp != NULL;
imp = ISC_LIST_NEXT(imp, link))
if (strcasecmp(name, imp->name) == 0)
imp = ISC_LIST_NEXT(imp, link)) {
if (strcasecmp(name, imp->name) == 0) {
return (imp);
}
}
return (NULL);
}
......@@ -367,10 +369,13 @@ dns_dyndb_load(const char *libname, const char *name, const char *parameters,
result = ISC_R_SUCCESS;
cleanup:
if (result != ISC_R_SUCCESS)
if (implementation != NULL)
if (result != ISC_R_SUCCESS) {
if (implementation != NULL) {
unload_library(&implementation);
}
}
UNLOCK(&dyndb_lock);
return (result);
}
......
......@@ -1925,12 +1925,16 @@ dns_diff_subtract(dns_diff_t diff[2], dns_diff_t *r)
if (p[0] == NULL && p[1] == NULL)
break;
for (i = 0; i < 2; i++)
for (i = 0; i < 2; i++) {
if (p[!i] == NULL) {
ISC_LIST_UNLINK(diff[i].tuples, p[i], link);
ISC_LIST_APPEND(r->tuples, p[i], link);
goto next;
{
ISC_LIST_UNLINK(diff[i].tuples, p[i],
link);
ISC_LIST_APPEND(r->tuples, p[i], link);
goto next;
}
}
}
t = rdata_order(&p[0], &p[1]);
if (t < 0) {
ISC_LIST_UNLINK(diff[0].tuples, p[0], link);
......
......@@ -363,25 +363,27 @@ gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *token, bool eol,
}
/*NOTREACHED*/
}
if (eol != true)
if (token->type == isc_tokentype_eol ||
token->type == isc_tokentype_eof) {
unsigned long int line;
const char * what;
const char * file;
file = isc_lex_getsourcename(lex);
line = isc_lex_getsourceline(lex);
if (token->type == isc_tokentype_eol) {
line--;
what = "line";
} else
what = "file";
(*callbacks->error)(callbacks,
"dns_master_load: %s:%lu: "
"unexpected end of %s",
file, line, what);
return (ISC_R_UNEXPECTEDEND);
}
if (eol != true) {
if (token->type == isc_tokentype_eol || token->type == isc_tokentype_eof) {
{
unsigned long int line;
const char *what;
const char *file;
file = isc_lex_getsourcename(lex);
line = isc_lex_getsourceline(lex);
if (token->type == isc_tokentype_eol) {
line--;
what = "line";
}else
what = "file";
(*callbacks->error)(callbacks,
"dns_master_load: %s:%lu: "
"unexpected end of %s",
file, line, what);
return (ISC_R_UNEXPECTEDEND);
}
}
}
return (ISC_R_SUCCESS);
}
......
......@@ -2475,9 +2475,11 @@ dns_name_isdnssd(const dns_name_t *name)
if (dns_name_countlabels(name) > 3U) {
dns_name_init(&prefix, NULL);
dns_name_getlabelsequence(name, 0, 3, &prefix);
for (i = 0; i < (sizeof(dns_sd) / sizeof(dns_sd[0])); i++)
if (dns_name_equal(&prefix, &dns_sd[i]))
for (i = 0; i < (sizeof(dns_sd) / sizeof(dns_sd[0])); i++) {
if (dns_name_equal(&prefix, &dns_sd[i])) {
return (true);
}
}
}
return (false);
......@@ -2534,9 +2536,11 @@ dns_name_isrfc1918(const dns_name_t *name)
{
size_t i;
for (i = 0; i < (sizeof(rfc1918names) / sizeof(*rfc1918names)); i++)
if (dns_name_issubdomain(name, &rfc1918names[i]))
for (i = 0; i < (sizeof(rfc1918names) / sizeof(*rfc1918names)); i++) {
if (dns_name_issubdomain(name, &rfc1918names[i])) {
return (true);
}
}
return (false);
}
......@@ -2553,9 +2557,11 @@ dns_name_isula(const dns_name_t *name)
{
size_t i;
for (i = 0; i < (sizeof(ulanames) / sizeof(*ulanames)); i++)
if (dns_name_issubdomain(name, &ulanames[i]))
for (i = 0; i < (sizeof(ulanames) / sizeof(*ulanames)); i++) {
if (dns_name_issubdomain(name, &ulanames[i])) {
return (true);
}
}
return (false);
}
......
......@@ -75,9 +75,11 @@ dns_nsec_compressbitmap(unsigned char *map, const unsigned char *raw,
for (window = 0; window < 256; window++) {
if (window * 256 > max_type)
break;
for (octet = 31; octet >= 0; octet--)
if (*(raw + octet) != 0)
for (octet = 31; octet >= 0; octet--) {
if (*(raw + octet) != 0) {
break;
}
}
if (octet < 0) {
raw += 32;
continue;
......
......@@ -137,10 +137,13 @@ dns_peerlist_addpeer(dns_peerlist_t *peers, dns_peer_t *peer)
* More specifics to front of list.
*/
for (p = ISC_LIST_HEAD(peers->elements); p != NULL;
p = ISC_LIST_NEXT(p, next))
if (p->prefixlen < peer->prefixlen)
p = ISC_LIST_NEXT(p, next)) {
if (p->prefixlen < peer->prefixlen) {
break;
}
}
if (p != NULL)
ISC_LIST_INSERTBEFORE(peers->elements, p, peer, next);
else
......
......@@ -249,13 +249,16 @@ err:
if (hKey != CK_INVALID_HANDLE)
(void)pkcs_C_DestroyObject(pk11_ctx->session, hKey);
for (i = 5; i <= 6; i++)
for (i = 5; i <= 6; i++) {
if (keyTemplate[i].pValue != NULL) {
memset(keyTemplate[i].pValue, 0,
keyTemplate[i].ulValueLen);
isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
keyTemplate[i].ulValueLen);
{
memset(keyTemplate[i].pValue, 0,
keyTemplate[i].ulValueLen);
isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
keyTemplate[i].ulValueLen);
}
}
}
pk11_return_session(pk11_ctx);
memset(pk11_ctx, 0, sizeof(*pk11_ctx));
isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
......@@ -340,13 +343,16 @@ err:
if (hKey != CK_INVALID_HANDLE)
(void)pkcs_C_DestroyObject(pk11_ctx->session, hKey);
for (i = 5; i <= 6; i++)
for (i = 5; i <= 6; i++) {
if (keyTemplate[i].pValue != NULL) {
memset(keyTemplate[i].pValue, 0,
keyTemplate[i].ulValueLen);
isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
keyTemplate[i].ulValueLen);
{
memset(keyTemplate[i].pValue, 0,
keyTemplate[i].ulValueLen);
isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
keyTemplate[i].ulValueLen);
}
}
}
pk11_return_session(pk11_ctx);
memset(pk11_ctx, 0, sizeof(*pk11_ctx));
isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
......
......@@ -230,13 +230,16 @@ err:
if (hKey != CK_INVALID_HANDLE)
(void)pkcs_C_DestroyObject(pk11_ctx->session, hKey);
for (i = 5; i <= 6; i++)
for (i = 5; i <= 6; i++) {
if (keyTemplate[i].pValue != NULL) {
memset(keyTemplate[i].pValue, 0,
keyTemplate[i].ulValueLen);
isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
keyTemplate[i].ulValueLen);
{
memset(keyTemplate[i].pValue, 0,
keyTemplate[i].ulValueLen);
isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
keyTemplate[i].ulValueLen);
}
}
}
pk11_return_session(pk11_ctx);
memset(pk11_ctx, 0, sizeof(*pk11_ctx));
isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
......@@ -328,13 +331,16 @@ err:
if (hKey != CK_INVALID_HANDLE)
(void)pkcs_C_DestroyObject(pk11_ctx->session, hKey);
for (i = 5; i <= 6; i++)
for (i = 5; i <= 6; i++) {
if (keyTemplate[i].pValue != NULL) {
memset(keyTemplate[i].pValue, 0,
keyTemplate[i].ulValueLen);
isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
keyTemplate[i].ulValueLen);
{
memset(keyTemplate[i].pValue, 0,
keyTemplate[i].ulValueLen);
isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
keyTemplate[i].ulValueLen);
}
}
}
pk11_return_session(pk11_ctx);
memset(pk11_ctx, 0, sizeof(*pk11_ctx));
isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
......
......@@ -233,26 +233,33 @@ token_key:
dctx->ctxdata.pk11_ctx = pk11_ctx;
for (i = 6; i <= 13; i++)
for (i = 6; i <= 13; i++) {
if (keyTemplate[i].pValue != NULL) {
isc_safe_memwipe(keyTemplate[i].pValue,
keyTemplate[i].ulValueLen);
isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
keyTemplate[i].ulValueLen);
{
isc_safe_memwipe(keyTemplate[i].pValue,
keyTemplate[i].ulValueLen);
isc_mem_put(dctx->mctx, keyTemplate[i].pValue,
keyTemplate[i].ulValueLen);
}
}
}
return (ISC_R_SUCCESS);
err:
if (!pk11_ctx->ontoken && (pk11_ctx->object != CK_INVALID_HANDLE))
(void)pkcs_C_DestroyObject(pk11_ctx->session, pk11_ctx->object);