Misc fixes (coverity)
This commit is contained in:
@@ -129,6 +129,7 @@ do_list(struct list_options *opt, const char *keytab_str)
|
|||||||
if (entry.aliases) {
|
if (entry.aliases) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
struct rk_strpool *p = NULL;
|
struct rk_strpool *p = NULL;
|
||||||
|
char *s;
|
||||||
|
|
||||||
for (i = 0; i< entry.aliases->len; i++) {
|
for (i = 0; i< entry.aliases->len; i++) {
|
||||||
krb5_unparse_name_fixed(context, entry.principal, buf, sizeof(buf));
|
krb5_unparse_name_fixed(context, entry.principal, buf, sizeof(buf));
|
||||||
@@ -136,7 +137,8 @@ do_list(struct list_options *opt, const char *keytab_str)
|
|||||||
i + 1 < entry.aliases->len ? ", " : "");
|
i + 1 < entry.aliases->len ? ", " : "");
|
||||||
|
|
||||||
}
|
}
|
||||||
rtbl_add_column_entry_by_id(table, 5, rk_strpoolcollect(p));
|
rtbl_add_column_entry_by_id(table, 5, (s = rk_strpoolcollect(p)));
|
||||||
|
free(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
krb5_kt_free_entry(context, &entry);
|
krb5_kt_free_entry(context, &entry);
|
||||||
|
@@ -475,10 +475,10 @@ test_wrap_ext(struct client *c1, int32_t hc1, struct client *c2, int32_t hc2,
|
|||||||
int32_t val;
|
int32_t val;
|
||||||
|
|
||||||
header.data = "header";
|
header.data = "header";
|
||||||
header.length = 6;
|
header.length = sizeof("header") - 1;
|
||||||
|
|
||||||
msg.data = "0123456789abcdef"; /* padded for most enctypes */
|
msg.data = "0123456789abcdef"; /* padded for most enctypes */
|
||||||
msg.length = 32;
|
msg.length = sizeof("0123456789abcdef") - 1;
|
||||||
|
|
||||||
trailer.data = "trailer";
|
trailer.data = "trailer";
|
||||||
trailer.length = 7;
|
trailer.length = 7;
|
||||||
|
@@ -993,8 +993,6 @@ db_replay_log_table_del_keys_iter(heim_object_t key, heim_object_t value,
|
|||||||
if (k == NULL)
|
if (k == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
k = (heim_data_t)key;
|
|
||||||
|
|
||||||
db->ret = db->plug->delf(db->db_data, db->current_table, k, &db->error);
|
db->ret = db->plug->delf(db->db_data, db->current_table, k, &db->error);
|
||||||
heim_release(k);
|
heim_release(k);
|
||||||
}
|
}
|
||||||
@@ -1409,6 +1407,7 @@ json_db_open(void *plug, const char *dbtype, const char *dbname,
|
|||||||
if (jsondb == NULL) {
|
if (jsondb == NULL) {
|
||||||
heim_release(contents);
|
heim_release(contents);
|
||||||
heim_release(dbname_s);
|
heim_release(dbname_s);
|
||||||
|
heim_release(bkpname_s);
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -611,8 +611,8 @@ gsskrb5_acceptor_start(OM_uint32 * minor_status,
|
|||||||
rkey);
|
rkey);
|
||||||
if (kret == 0)
|
if (kret == 0)
|
||||||
use_subkey = 1;
|
use_subkey = 1;
|
||||||
krb5_free_keyblock(context, rkey);
|
|
||||||
}
|
}
|
||||||
|
krb5_free_keyblock(context, rkey);
|
||||||
}
|
}
|
||||||
if (use_subkey) {
|
if (use_subkey) {
|
||||||
ctx->more_flags |= ACCEPTOR_SUBKEY;
|
ctx->more_flags |= ACCEPTOR_SUBKEY;
|
||||||
|
@@ -149,7 +149,6 @@ static OM_uint32 inquire_sec_context_get_subkey
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = krb5_store_keyblock(sp, *key);
|
ret = krb5_store_keyblock(sp, *key);
|
||||||
krb5_free_keyblock (context, key);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
@@ -169,6 +168,7 @@ static OM_uint32 inquire_sec_context_get_subkey
|
|||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
krb5_free_keyblock(context, key);
|
||||||
krb5_data_free(&data);
|
krb5_data_free(&data);
|
||||||
if (sp)
|
if (sp)
|
||||||
krb5_storage_free(sp);
|
krb5_storage_free(sp);
|
||||||
|
@@ -531,6 +531,7 @@ OM_uint32 GSSAPI_CALLCONV _gss_spnego_import_sec_context (
|
|||||||
gss_ctx_id_t context;
|
gss_ctx_id_t context;
|
||||||
gssspnego_ctx ctx;
|
gssspnego_ctx ctx;
|
||||||
|
|
||||||
|
*context_handle = GSS_C_NO_CONTEXT;
|
||||||
ret = _gss_spnego_alloc_sec_context(minor_status, &context);
|
ret = _gss_spnego_alloc_sec_context(minor_status, &context);
|
||||||
if (ret != GSS_S_COMPLETE) {
|
if (ret != GSS_S_COMPLETE) {
|
||||||
return ret;
|
return ret;
|
||||||
@@ -543,7 +544,7 @@ OM_uint32 GSSAPI_CALLCONV _gss_spnego_import_sec_context (
|
|||||||
interprocess_token,
|
interprocess_token,
|
||||||
&ctx->negotiated_ctx_id);
|
&ctx->negotiated_ctx_id);
|
||||||
if (ret != GSS_S_COMPLETE) {
|
if (ret != GSS_S_COMPLETE) {
|
||||||
_gss_spnego_internal_delete_sec_context(&minor, context_handle, GSS_C_NO_BUFFER);
|
_gss_spnego_internal_delete_sec_context(&minor, &context, GSS_C_NO_BUFFER);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -499,11 +499,10 @@ hdb_sqlite_fetch_kvno(krb5_context context, HDB *db, krb5_const_principal princi
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = bind_principal(context, principal, fetch, 1);
|
ret = bind_principal(context, principal, fetch, 1);
|
||||||
|
krb5_free_principal(context, enterprise_principal);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
krb5_free_principal(context, enterprise_principal);
|
|
||||||
|
|
||||||
sqlite_error = hdb_sqlite_step(context, hsdb->db, fetch);
|
sqlite_error = hdb_sqlite_step(context, hsdb->db, fetch);
|
||||||
if (sqlite_error != SQLITE_ROW) {
|
if (sqlite_error != SQLITE_ROW) {
|
||||||
if(sqlite_error == SQLITE_DONE) {
|
if(sqlite_error == SQLITE_DONE) {
|
||||||
|
@@ -337,8 +337,10 @@ load_ocsp(hx509_context context, struct revoke_ocsp *ocsp)
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = stat(ocsp->path, &sb);
|
ret = stat(ocsp->path, &sb);
|
||||||
if (ret)
|
if (ret) {
|
||||||
|
rk_xfree(data);
|
||||||
return errno;
|
return errno;
|
||||||
|
}
|
||||||
|
|
||||||
ret = parse_ocsp_basic(data, length, &basic);
|
ret = parse_ocsp_basic(data, length, &basic);
|
||||||
rk_xfree(data);
|
rk_xfree(data);
|
||||||
|
@@ -379,21 +379,22 @@ kadm5_add_passwd_quality_verifier(krb5_context context,
|
|||||||
|
|
||||||
if(check_library == NULL) {
|
if(check_library == NULL) {
|
||||||
krb5_error_code ret;
|
krb5_error_code ret;
|
||||||
|
char **strs;
|
||||||
char **tmp;
|
char **tmp;
|
||||||
|
|
||||||
tmp = krb5_config_get_strings(context, NULL,
|
strs = krb5_config_get_strings(context, NULL,
|
||||||
"password_quality",
|
"password_quality",
|
||||||
"policy_libraries",
|
"policy_libraries",
|
||||||
NULL);
|
NULL);
|
||||||
if(tmp == NULL || *tmp == NULL)
|
if(strs == NULL || *strs == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
while (*tmp) {
|
for (tmp = strs; *tmp; tmp++) {
|
||||||
ret = add_verifier(context, *tmp);
|
ret = add_verifier(context, *tmp);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
tmp++;
|
|
||||||
}
|
}
|
||||||
|
krb5_config_free_strings(strs);
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return add_verifier(context, check_library);
|
return add_verifier(context, check_library);
|
||||||
|
@@ -1902,6 +1902,7 @@ _krb5_make_fast_ap_fxarmor(krb5_context context,
|
|||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
krb5_auth_con_free(context, auth_context);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user