From a512f5779d0e84c3a418055d8fe653f30bcf5601 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Wed, 28 Jan 2009 00:04:15 +0000 Subject: [PATCH] Start to phase out krb5_xfree macro, which just casts its argument to char* and calls free. Replace most uses, outside of the LDAP KDB plugin, which doesn't build on my test system of the moment because of version dependencies. Add one explicit cast to make the change warning-neutral (under gcc 4.0.1 on Mac OS X 10.5.6). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21812 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin/dbutil/dump.c | 14 +-- src/kadmin/ktutil/ktutil.c | 2 +- src/kadmin/server/schpw.c | 10 +- src/lib/crypto/des/afsstring2key.c | 4 +- src/lib/crypto/keyblocks.c | 4 +- src/lib/crypto/keyed_checksum_types.c | 2 +- src/lib/kadm5/alt_prof.c | 36 +++--- src/lib/kadm5/str_conv.c | 2 +- src/lib/kdb/decrypt_key.c | 6 +- src/lib/kdb/encrypt_key.c | 6 +- src/lib/kdb/kdb5.c | 2 +- src/lib/kdb/kdb_cpw.c | 6 +- src/lib/kdb/kdb_default.c | 2 +- src/lib/kdb/keytab.c | 2 +- src/lib/krb5/ccache/cc_file.c | 22 ++-- src/lib/krb5/ccache/cc_keyring.c | 32 +++--- src/lib/krb5/ccache/cc_memory.c | 16 +-- src/lib/krb5/ccache/cc_mslsa.c | 18 +-- src/lib/krb5/keytab/kt_file.c | 24 ++-- src/lib/krb5/keytab/kt_memory.c | 64 +++++------ src/lib/krb5/keytab/kt_srvtab.c | 14 +-- src/lib/krb5/keytab/ktfr_entry.c | 2 +- src/lib/krb5/krb/auth_con.c | 6 +- src/lib/krb5/krb/bld_pr_ext.c | 14 +-- src/lib/krb5/krb/bld_princ.c | 10 +- src/lib/krb5/krb/chpw.c | 2 +- src/lib/krb5/krb/conv_princ.c | 2 +- src/lib/krb5/krb/copy_addrs.c | 2 +- src/lib/krb5/krb/copy_athctr.c | 12 +- src/lib/krb5/krb/copy_auth.c | 2 +- src/lib/krb5/krb/copy_cksum.c | 2 +- src/lib/krb5/krb/copy_creds.c | 6 +- src/lib/krb5/krb/copy_data.c | 2 +- src/lib/krb5/krb/copy_key.c | 2 +- src/lib/krb5/krb/copy_tick.c | 24 ++-- src/lib/krb5/krb/free_rtree.c | 2 +- src/lib/krb5/krb/fwd_tgt.c | 2 +- src/lib/krb5/krb/gc_via_tkt.c | 2 +- src/lib/krb5/krb/gen_subkey.c | 2 +- src/lib/krb5/krb/get_creds.c | 4 +- src/lib/krb5/krb/get_in_tkt.c | 10 +- src/lib/krb5/krb/gic_keytab.c | 2 +- src/lib/krb5/krb/gic_pwd.c | 10 +- src/lib/krb5/krb/kfree.c | 156 +++++++++++++------------- src/lib/krb5/krb/mk_cred.c | 6 +- src/lib/krb5/krb/mk_error.c | 2 +- src/lib/krb5/krb/mk_priv.c | 8 +- src/lib/krb5/krb/mk_rep.c | 2 +- src/lib/krb5/krb/mk_req_ext.c | 10 +- src/lib/krb5/krb/mk_safe.c | 10 +- src/lib/krb5/krb/parse.c | 32 +++--- src/lib/krb5/krb/preauth.c | 10 +- src/lib/krb5/krb/preauth2.c | 24 ++-- src/lib/krb5/krb/rd_cred.c | 10 +- src/lib/krb5/krb/rd_priv.c | 12 +- src/lib/krb5/krb/rd_req_dec.c | 12 +- src/lib/krb5/krb/rd_safe.c | 6 +- src/lib/krb5/krb/recvauth.c | 10 +- src/lib/krb5/krb/send_tgs.c | 20 ++-- src/lib/krb5/krb/sendauth.c | 8 +- src/lib/krb5/krb/ser_princ.c | 4 +- src/lib/krb5/krb/serialize.c | 2 +- src/lib/krb5/krb/set_realm.c | 2 +- src/lib/krb5/krb/srv_rcache.c | 4 +- src/lib/krb5/krb/t_ser.c | 12 +- src/lib/krb5/krb/vfy_increds.c | 2 +- src/lib/krb5/os/an_to_ln.c | 10 +- src/lib/krb5/os/free_krbhs.c | 2 +- src/lib/krb5/os/full_ipadr.c | 2 +- src/lib/krb5/os/localaddr.c | 2 +- src/lib/krb5/os/locate_kdc.c | 8 +- src/lib/krb5/os/read_msg.c | 2 +- src/lib/krb5/os/sn2princ.c | 2 +- src/lib/krb5/rcache/rc_dfl.c | 12 +- src/tests/asn.1/krb5_decode_test.c | 10 +- 75 files changed, 412 insertions(+), 412 deletions(-) diff --git a/src/kadmin/dbutil/dump.c b/src/kadmin/dbutil/dump.c index 7c7bf3203..24f4d09f2 100644 --- a/src/kadmin/dbutil/dump.c +++ b/src/kadmin/dbutil/dump.c @@ -585,8 +585,8 @@ dump_k5beta_iterator(ptr, entry) krb5_dbe_lookup_last_pwd_change(arg->kcontext, entry, &last_pwd_change))) { fprintf(stderr, nokeys_err, arg->programname, name); - krb5_xfree(mod_name); - krb5_xfree(name); + free(mod_name); + free(name); return(retval); } @@ -602,8 +602,8 @@ dump_k5beta_iterator(ptr, entry) KRB5_KDB_SALTTYPE_V4, &akey))) { fprintf(stderr, nokeys_err, arg->programname, name); - krb5_xfree(mod_name); - krb5_xfree(name); + free(mod_name); + free(name); return(retval); } @@ -668,9 +668,9 @@ dump_k5beta_iterator(ptr, entry) /* If we're blabbing, do it */ if (arg->verbose) fprintf(stderr, "%s\n", name); - krb5_xfree(mod_name); + free(mod_name); } - krb5_xfree(name); + free(name); return(0); } @@ -845,7 +845,7 @@ dump_k5beta6_iterator_ext(ptr, entry, kadm) retval = EINVAL; } } - krb5_xfree(name); + free(name); return(retval); } diff --git a/src/kadmin/ktutil/ktutil.c b/src/kadmin/ktutil/ktutil.c index 26a2b9ddb..5a6ee783b 100644 --- a/src/kadmin/ktutil/ktutil.c +++ b/src/kadmin/ktutil/ktutil.c @@ -265,7 +265,7 @@ void ktutil_list(argc, argv) printf(")"); } printf("\n"); - krb5_xfree(pname); + free(pname); } } diff --git a/src/kadmin/server/schpw.c b/src/kadmin/server/schpw.c index 517ea7d2c..c3b7fa1e3 100644 --- a/src/kadmin/server/schpw.c +++ b/src/kadmin/server/schpw.c @@ -251,7 +251,7 @@ process_chpw_request(context, server_handle, realm, keytab, /* zap the password */ memset(clear.data, 0, clear.length); memset(ptr, 0, clear.length); - krb5_xfree(clear.data); + free(clear.data); free(ptr); clear.length = 0; @@ -378,7 +378,7 @@ chpwfail: reply */ if (ap_rep.length) { - krb5_xfree(ap_rep.data); + free(ap_rep.data); ap_rep.length = 0; } @@ -457,13 +457,13 @@ bailout: if (changepw) krb5_free_principal(context, changepw); if (ap_rep.length) - krb5_xfree(ap_rep.data); + free(ap_rep.data); if (ticket) krb5_free_ticket(context, ticket); if (clear.length) - krb5_xfree(clear.data); + free(clear.data); if (cipher.length) - krb5_xfree(cipher.data); + free(cipher.data); if (target) krb5_free_principal(context, target); if (targetstr) diff --git a/src/lib/crypto/des/afsstring2key.c b/src/lib/crypto/des/afsstring2key.c index 97ec2d8a1..571dab007 100644 --- a/src/lib/crypto/des/afsstring2key.c +++ b/src/lib/crypto/des/afsstring2key.c @@ -149,11 +149,11 @@ mit_afs_string_to_key (krb5_keyblock *keyblock, const krb5_data *data, /* clean & free the input string */ memset(password, 0, (size_t) pw_len); - krb5_xfree(password); + free(password); } #if 0 /* must free here because it was copied for this special case */ - krb5_xfree(salt->data); + free(salt->data); #endif return 0; } diff --git a/src/lib/crypto/keyblocks.c b/src/lib/crypto/keyblocks.c index 626443c83..5e698cc5a 100644 --- a/src/lib/crypto/keyblocks.c +++ b/src/lib/crypto/keyblocks.c @@ -65,7 +65,7 @@ void krb5int_c_free_keyblock(krb5_context context, register krb5_keyblock *val) { krb5int_c_free_keyblock_contents(context, val); - krb5_xfree(val); + free(val); } void @@ -73,7 +73,7 @@ krb5int_c_free_keyblock_contents(krb5_context context, register krb5_keyblock *k { if (key->contents) { krb5int_zap_data (key->contents, key->length); - krb5_xfree(key->contents); + free(key->contents); key->contents = 0; } } diff --git a/src/lib/crypto/keyed_checksum_types.c b/src/lib/crypto/keyed_checksum_types.c index 0e46466f2..04aa44757 100644 --- a/src/lib/crypto/keyed_checksum_types.c +++ b/src/lib/crypto/keyed_checksum_types.c @@ -83,7 +83,7 @@ void KRB5_CALLCONV krb5_free_cksumtypes(krb5_context context, krb5_cksumtype *val) { if (val) - krb5_xfree(val); + free(val); return; } diff --git a/src/lib/kadm5/alt_prof.c b/src/lib/kadm5/alt_prof.c index c8ad3c741..2d8ca15a9 100644 --- a/src/lib/kadm5/alt_prof.c +++ b/src/lib/kadm5/alt_prof.c @@ -639,7 +639,7 @@ krb5_error_code kadm5_get_config_params(context, use_kdc_config, !krb5_aprof_get_string(aprofile, hierarchy, TRUE, &svalue)) { if (!krb5_string_to_enctype(svalue, ¶ms.enctype)) { params.mask |= KADM5_CONFIG_ENCTYPE; - krb5_xfree(svalue); + free(svalue); } } else { params.mask |= KADM5_CONFIG_ENCTYPE; @@ -678,7 +678,7 @@ krb5_error_code kadm5_get_config_params(context, use_kdc_config, !krb5_aprof_get_string(aprofile, hierarchy, TRUE, &svalue)) { if (!krb5_string_to_timestamp(svalue, ¶ms.expiration)) { params.mask |= KADM5_CONFIG_EXPIRATION; - krb5_xfree(svalue); + free(svalue); } } else { params.mask |= KADM5_CONFIG_EXPIRATION; @@ -721,7 +721,7 @@ krb5_error_code kadm5_get_config_params(context, use_kdc_config, } if (!sp) params.mask |= KADM5_CONFIG_FLAGS; - krb5_xfree(svalue); + free(svalue); } else { params.mask |= KADM5_CONFIG_FLAGS; params.flags = KRB5_KDB_DEF_FLAGS; @@ -761,7 +761,7 @@ krb5_error_code kadm5_get_config_params(context, use_kdc_config, if (params.num_keysalts) params.mask |= KADM5_CONFIG_ENCTYPES; - krb5_xfree(svalue); + free(svalue); } hierarchy[2] = "iprop_enable"; @@ -991,7 +991,7 @@ krb5_read_realm_params(kcontext, realm, rparamp) if (!krb5_aprof_get_string(aprofile, hierarchy, TRUE, &svalue)) { if (!krb5_string_to_enctype(svalue, &rparams->realm_enctype)) rparams->realm_enctype_valid = 1; - krb5_xfree(svalue); + free(svalue); } /* Get the value for the stashfile */ @@ -1019,7 +1019,7 @@ krb5_read_realm_params(kcontext, realm, rparamp) if (!krb5_string_to_timestamp(svalue, &rparams->realm_expiration)) rparams->realm_expiration_valid = 1; - krb5_xfree(svalue); + free(svalue); } hierarchy[2] = "reject_bad_transit"; @@ -1080,7 +1080,7 @@ krb5_read_realm_params(kcontext, realm, rparamp) } if (!sp) rparams->realm_flags_valid = 1; - krb5_xfree(svalue); + free(svalue); } rparams->realm_keysalts = NULL; @@ -1108,17 +1108,17 @@ krb5_free_realm_params(kcontext, rparams) krb5_realm_params *rparams; { if (rparams) { - krb5_xfree(rparams->realm_profile); - krb5_xfree(rparams->realm_dbname); - krb5_xfree(rparams->realm_mkey_name); - krb5_xfree(rparams->realm_stash_file); - krb5_xfree(rparams->realm_keysalts); - krb5_xfree(rparams->realm_kdc_ports); - krb5_xfree(rparams->realm_kdc_tcp_ports); - krb5_xfree(rparams->realm_acl_file); - krb5_xfree(rparams->realm_no_host_referral); - krb5_xfree(rparams->realm_host_based_services); - krb5_xfree(rparams); + free(rparams->realm_profile); + free(rparams->realm_dbname); + free(rparams->realm_mkey_name); + free(rparams->realm_stash_file); + free(rparams->realm_keysalts); + free(rparams->realm_kdc_ports); + free(rparams->realm_kdc_tcp_ports); + free(rparams->realm_acl_file); + free(rparams->realm_no_host_referral); + free(rparams->realm_host_based_services); + free(rparams); } return(0); } diff --git a/src/lib/kadm5/str_conv.c b/src/lib/kadm5/str_conv.c index c35d51521..3d60d7902 100644 --- a/src/lib/kadm5/str_conv.c +++ b/src/lib/kadm5/str_conv.c @@ -327,7 +327,7 @@ krb5_string_to_keysalts(string, tupleseps, ksaltseps, dups, ksaltp, nksaltp) if (savep) { memcpy(*ksaltp, savep, len * sizeof(krb5_key_salt_tuple)); - krb5_xfree(savep); + free(savep); } /* Save our values */ diff --git a/src/lib/kdb/decrypt_key.c b/src/lib/kdb/decrypt_key.c index 9ab66dfbf..a564c37b0 100644 --- a/src/lib/kdb/decrypt_key.c +++ b/src/lib/kdb/decrypt_key.c @@ -90,7 +90,7 @@ krb5_dbekd_def_decrypt_key_data( krb5_context context, if ((retval = krb5_c_decrypt(context, mkey, 0 /* XXX */, 0, &cipher, &plain))) { - krb5_xfree(plain.data); + free(plain.data); return retval; } @@ -101,7 +101,7 @@ krb5_dbekd_def_decrypt_key_data( krb5_context context, any better than that. */ if (tmplen > plain.length) { - krb5_xfree(plain.data); + free(plain.data); return(KRB5_CRYPTO_INTERNAL); } @@ -118,7 +118,7 @@ krb5_dbekd_def_decrypt_key_data( krb5_context context, if ((keysalt->data.length = key_data->key_data_length[1])) { if (!(keysalt->data.data=(char *)malloc(keysalt->data.length))){ if (key_data->key_data_contents[0]) { - krb5_xfree(dbkey->contents); + free(dbkey->contents); dbkey->contents = 0; dbkey->length = 0; } diff --git a/src/lib/kdb/encrypt_key.c b/src/lib/kdb/encrypt_key.c index bf778ea85..0db1a029a 100644 --- a/src/lib/kdb/encrypt_key.c +++ b/src/lib/kdb/encrypt_key.c @@ -79,7 +79,7 @@ krb5_dbekd_def_encrypt_key_data( krb5_context context, for (i = 0; i < key_data->key_data_ver; i++) if (key_data->key_data_contents[i]) - krb5_xfree(key_data->key_data_contents[i]); + free(key_data->key_data_contents[i]); key_data->key_data_ver = 1; key_data->key_data_kvno = keyver; @@ -110,7 +110,7 @@ krb5_dbekd_def_encrypt_key_data( krb5_context context, if ((retval = krb5_c_encrypt(context, mkey, /* XXX */ 0, 0, &plain, &cipher))) { - krb5_xfree(key_data->key_data_contents[0]); + free(key_data->key_data_contents[0]); return retval; } @@ -123,7 +123,7 @@ krb5_dbekd_def_encrypt_key_data( krb5_context context, key_data->key_data_contents[1] = (krb5_octet *)malloc(keysalt->data.length); if (key_data->key_data_contents[1] == NULL) { - krb5_xfree(key_data->key_data_contents[0]); + free(key_data->key_data_contents[0]); return ENOMEM; } memcpy(key_data->key_data_contents[1], keysalt->data.data, diff --git a/src/lib/kdb/kdb5.c b/src/lib/kdb/kdb5.c index 5cc67f9b3..88df6bcc6 100644 --- a/src/lib/kdb/kdb5.c +++ b/src/lib/kdb/kdb5.c @@ -1533,7 +1533,7 @@ krb5_db_fetch_mkey(krb5_context context, } if (!salt) - krb5_xfree(scratch.data); + free(scratch.data); memset(password, 0, sizeof(password)); /* erase it */ } else { diff --git a/src/lib/kdb/kdb_cpw.c b/src/lib/kdb/kdb_cpw.c index 86bec7a43..a59d98e73 100644 --- a/src/lib/kdb/kdb_cpw.c +++ b/src/lib/kdb/kdb_cpw.c @@ -412,7 +412,7 @@ add_key_pwd(context, master_key, ks_tuple, ks_tuple_count, passwd, return(retval); key_salt.data = *saltdata; - krb5_xfree(saltdata); + free(saltdata); } break; case KRB5_KDB_SALTTYPE_NOREALM: @@ -438,7 +438,7 @@ add_key_pwd(context, master_key, ks_tuple, ks_tuple_count, passwd, key_salt.data = *saltdata; key_salt.data.length = SALT_TYPE_AFS_LENGTH; /*length actually used below...*/ - krb5_xfree(saltdata); + free(saltdata); #else /* Why do we do this? Well, the afs_mit_string_to_key needs to use strlen, and the realm is not NULL terminated.... */ @@ -481,7 +481,7 @@ add_key_pwd(context, master_key, ks_tuple, ks_tuple_count, passwd, kvno, &tmp_key_data); if (key_salt.data.data) free(key_salt.data.data); - krb5_xfree(key.contents); + free(key.contents); if( retval ) return retval; diff --git a/src/lib/kdb/kdb_default.c b/src/lib/kdb/kdb_default.c index e1e54e307..f173e127d 100644 --- a/src/lib/kdb/kdb_default.c +++ b/src/lib/kdb/kdb_default.c @@ -469,7 +469,7 @@ krb5_def_verify_master_key(krb5_context context, } memset((char *)tempkey.contents, 0, tempkey.length); - krb5_xfree(tempkey.contents); + free(tempkey.contents); krb5_db_free_principal(context, &master_entry, nprinc); return retval; diff --git a/src/lib/kdb/keytab.c b/src/lib/kdb/keytab.c index 395b56d61..632c9270d 100644 --- a/src/lib/kdb/keytab.c +++ b/src/lib/kdb/keytab.c @@ -92,7 +92,7 @@ krb5_ktkdb_close(context, kt) */ kt->ops = NULL; - krb5_xfree(kt); + free(kt); return 0; } diff --git a/src/lib/krb5/ccache/cc_file.c b/src/lib/krb5/ccache/cc_file.c index 71476d778..9e54d1bdd 100644 --- a/src/lib/krb5/ccache/cc_file.c +++ b/src/lib/krb5/ccache/cc_file.c @@ -530,7 +530,7 @@ krb5_fcc_read_principal(krb5_context context, krb5_ccache id, krb5_principal *pr errout: while(--i >= 0) free(krb5_princ_component(context, tmpprinc, i)->data); - krb5_xfree(krb5_princ_realm(context, tmpprinc)->data); + free(krb5_princ_realm(context, tmpprinc)->data); free((char *)tmpprinc->data); free((char *)tmpprinc); return kret; @@ -628,7 +628,7 @@ krb5_fcc_read_keyblock(krb5_context context, krb5_ccache id, krb5_keyblock *keyb return KRB5_OK; errout: if (keyblock->contents) { - krb5_xfree(keyblock->contents); + free(keyblock->contents); keyblock->contents = NULL; } return kret; @@ -669,7 +669,7 @@ krb5_fcc_read_data(krb5_context context, krb5_ccache id, krb5_data *data) return KRB5_OK; errout: if (data->data) { - krb5_xfree(data->data); + free(data->data); data->data = NULL; } return kret; @@ -714,7 +714,7 @@ krb5_fcc_read_addr(krb5_context context, krb5_ccache id, krb5_address *addr) return KRB5_OK; errout: if (addr->contents) { - krb5_xfree(addr->contents); + free(addr->contents); addr->contents = NULL; } return kret; @@ -898,7 +898,7 @@ krb5_fcc_read_authdatum(krb5_context context, krb5_ccache id, krb5_authdata *a) return KRB5_OK; errout: if (a->contents) { - krb5_xfree(a->contents); + free(a->contents); a->contents = NULL; } return kret; @@ -1541,7 +1541,7 @@ static krb5_error_code KRB5_CALLCONV krb5_fcc_close(krb5_context context, krb5_ccache id) { dereference(context, (krb5_fcc_data *) id->data); - krb5_xfree(id); + free(id); return KRB5_OK; } @@ -1676,7 +1676,7 @@ krb5_fcc_destroy(krb5_context context, krb5_ccache id) cleanup: k5_cc_mutex_unlock(context, &data->lock); dereference(context, data); - krb5_xfree(id); + free(id); krb5_change_cache (); return kret; @@ -1828,7 +1828,7 @@ krb5_fcc_start_seq_get(krb5_context context, krb5_ccache id, if (OPENCLOSE(id)) { kret = krb5_fcc_open_file(context, id, FCC_OPEN_RDONLY); if (kret) { - krb5_xfree(fcursor); + free(fcursor); k5_cc_mutex_unlock(context, &data->lock); return kret; } @@ -1837,12 +1837,12 @@ krb5_fcc_start_seq_get(krb5_context context, krb5_ccache id, /* Make sure we start reading right after the primary principal */ kret = krb5_fcc_skip_header(context, id); if (kret) { - krb5_xfree(fcursor); + free(fcursor); goto done; } kret = krb5_fcc_skip_principal(context, id); if (kret) { - krb5_xfree(fcursor); + free(fcursor); goto done; } @@ -1959,7 +1959,7 @@ krb5_fcc_end_seq_get(krb5_context context, krb5_ccache id, krb5_cc_cursor *curso and if not, fcc_start_seq_get and/or fcc_next_cred will do the MAYBE_CLOSE. MAYBE_CLOSE(context, id, kret); */ - krb5_xfree((krb5_fcc_cursor *) *cursor); + free((krb5_fcc_cursor *) *cursor); return 0; } diff --git a/src/lib/krb5/ccache/cc_keyring.c b/src/lib/krb5/ccache/cc_keyring.c index f2624ecca..528f43f06 100644 --- a/src/lib/krb5/ccache/cc_keyring.c +++ b/src/lib/krb5/ccache/cc_keyring.c @@ -427,11 +427,11 @@ krb5_krcc_close(krb5_context context, krb5_ccache id) d = (krb5_krcc_data *) id->data; - krb5_xfree(d->name); + free(d->name); k5_cc_mutex_destroy(&d->lock); - krb5_xfree(d); + free(d); - krb5_xfree(id); + free(id); return KRB5_OK; } @@ -498,7 +498,7 @@ krb5_krcc_destroy(krb5_context context, krb5_ccache id) return kret; krb5_krcc_clearcache(context, id); - krb5_xfree(d->name); + free(d->name); res = keyctl_unlink(d->ring_id, d->parent_id); if (res < 0) { kret = errno; @@ -509,8 +509,8 @@ krb5_krcc_destroy(krb5_context context, krb5_ccache id) cleanup: k5_cc_mutex_unlock(context, &d->lock); k5_cc_mutex_destroy(&d->lock); - krb5_xfree(d); - krb5_xfree(id); + free(d); + free(id); krb5_change_cache(); @@ -811,14 +811,14 @@ krb5_krcc_new_data(const char *name, key_serial_t ring, kret = k5_cc_mutex_init(&d->lock); if (kret) { - krb5_xfree(d); + free(d); return kret; } d->name = strdup(name); if (d->name == NULL) { k5_cc_mutex_destroy(&d->lock); - krb5_xfree(d); + free(d); return KRB5_CC_NOMEM; } d->princ_id = 0; @@ -917,7 +917,7 @@ krb5_krcc_generate_new(krb5_context context, krb5_ccache * id) kret = krb5_krcc_new_data(uniquename, key, ring_id, &d); k5_cc_mutex_unlock(context, &krb5int_krcc_mutex); if (kret) { - krb5_xfree(lid); + free(lid); return kret; } lid->data = d; @@ -1339,13 +1339,13 @@ krb5_krcc_parse_cred(krb5_context context, krb5_ccache id, krb5_creds * creds, cleanticket: memset(creds->ticket.data, 0, (unsigned) creds->ticket.length); - krb5_xfree(creds->ticket.data); + free(creds->ticket.data); cleanauthdata: krb5_free_authdata(context, creds->authdata); cleanaddrs: krb5_free_addresses(context, creds->addresses); cleanblock: - krb5_xfree(creds->keyblock.contents); + free(creds->keyblock.contents); cleanserver: krb5_free_principal(context, creds->server); cleanclient: @@ -1414,7 +1414,7 @@ krb5_krcc_parse_principal(krb5_context context, krb5_ccache id, errout: while (--i >= 0) free(krb5_princ_component(context, tmpprinc, i)->data); - krb5_xfree(krb5_princ_realm(context, tmpprinc)->data); + free(krb5_princ_realm(context, tmpprinc)->data); free((char *) tmpprinc->data); free((char *) tmpprinc); return kret; @@ -1456,7 +1456,7 @@ krb5_krcc_parse_keyblock(krb5_context context, krb5_ccache id, return KRB5_OK; errout: if (keyblock->contents) - krb5_xfree(keyblock->contents); + free(keyblock->contents); return kret; } @@ -1523,7 +1523,7 @@ krb5_krcc_parse_krb5data(krb5_context context, krb5_ccache id, return KRB5_OK; errout: if (data->data) - krb5_xfree(data->data); + free(data->data); return kret; } @@ -1632,7 +1632,7 @@ krb5_krcc_parse_addr(krb5_context context, krb5_ccache id, krb5_address * addr, return KRB5_OK; errout: if (addr->contents) - krb5_xfree(addr->contents); + free(addr->contents); return kret; } @@ -1725,7 +1725,7 @@ krb5_krcc_parse_authdatum(krb5_context context, krb5_ccache id, return KRB5_OK; errout: if (a->contents) - krb5_xfree(a->contents); + free(a->contents); return kret; } diff --git a/src/lib/krb5/ccache/cc_memory.c b/src/lib/krb5/ccache/cc_memory.c index cdddc58f5..2cfd60a10 100644 --- a/src/lib/krb5/ccache/cc_memory.c +++ b/src/lib/krb5/ccache/cc_memory.c @@ -179,7 +179,7 @@ krb5_mcc_initialize(krb5_context context, krb5_ccache id, krb5_principal princ) krb5_error_code KRB5_CALLCONV krb5_mcc_close(krb5_context context, krb5_ccache id) { - krb5_xfree(id); + free(id); return KRB5_OK; } @@ -193,7 +193,7 @@ krb5_mcc_free(krb5_context context, krb5_ccache id) for (curr = d->link; curr;) { krb5_free_creds(context, curr->creds); next = curr->next; - krb5_xfree(curr); + free(curr); curr = next; } d->link = NULL; @@ -234,11 +234,11 @@ krb5_mcc_destroy(krb5_context context, krb5_ccache id) return err; krb5_mcc_free(context, id); - krb5_xfree(d->name); + free(d->name); k5_cc_mutex_unlock(context, &d->lock); k5_cc_mutex_destroy(&d->lock); - krb5_xfree(d); - krb5_xfree(id); + free(d); + free(id); krb5_change_cache (); return KRB5_OK; @@ -411,14 +411,14 @@ new_mcc_data (const char *name, krb5_mcc_data **dataptr) err = k5_cc_mutex_init(&d->lock); if (err) { - krb5_xfree(d); + free(d); return err; } d->name = strdup(name); if (d->name == NULL) { k5_cc_mutex_destroy(&d->lock); - krb5_xfree(d); + free(d); return KRB5_CC_NOMEM; } d->link = NULL; @@ -501,7 +501,7 @@ krb5_mcc_generate_new (krb5_context context, krb5_ccache *id) k5_cc_mutex_unlock(context, &krb5int_mcc_mutex); if (err) { - krb5_xfree(lid); + free(lid); return err; } lid->data = d; diff --git a/src/lib/krb5/ccache/cc_mslsa.c b/src/lib/krb5/ccache/cc_mslsa.c index 80c5b4832..db74828f3 100644 --- a/src/lib/krb5/ccache/cc_mslsa.c +++ b/src/lib/krb5/ccache/cc_mslsa.c @@ -489,7 +489,7 @@ MSTicketToMITTicket(KERB_EXTERNAL_TICKET *msticket, krb5_context context, krb5_d return FALSE; memcpy(ticket, newdata, sizeof(krb5_data)); - krb5_xfree(newdata); + free(newdata); return TRUE; } @@ -2056,7 +2056,7 @@ krb5_lcc_resolve (krb5_context context, krb5_ccache *id, const char *residual) lid->data = (krb5_pointer) malloc(sizeof(krb5_lcc_data)); if (lid->data == NULL) { - krb5_xfree(lid); + free(lid); CloseHandle(LogonHandle); return KRB5_CC_NOMEM; } @@ -2069,8 +2069,8 @@ krb5_lcc_resolve (krb5_context context, krb5_ccache *id, const char *residual) data->cc_name = (char *)malloc(strlen(residual)+1); if (data->cc_name == NULL) { - krb5_xfree(lid->data); - krb5_xfree(lid); + free(lid->data); + free(lid); CloseHandle(LogonHandle); return KRB5_CC_NOMEM; } @@ -2090,9 +2090,9 @@ krb5_lcc_resolve (krb5_context context, krb5_ccache *id, const char *residual) krb5_copy_principal(context, creds.client, &data->princ); krb5_free_cred_contents(context,&creds); } else if (!does_retrieve_ticket_cache_ticket()) { - krb5_xfree(data->cc_name); - krb5_xfree(lid->data); - krb5_xfree(lid); + free(data->cc_name); + free(lid->data); + free(lid); CloseHandle(LogonHandle); return KRB5_FCC_NOFILE; } @@ -2169,9 +2169,9 @@ krb5_lcc_close(krb5_context context, krb5_ccache id) if (data) { CloseHandle(data->LogonHandle); - krb5_xfree(data); + free(data); } - krb5_xfree(id); + free(id); } return closeval; } diff --git a/src/lib/krb5/keytab/kt_file.c b/src/lib/krb5/keytab/kt_file.c index 83fb26485..2e33886a7 100644 --- a/src/lib/krb5/keytab/kt_file.c +++ b/src/lib/krb5/keytab/kt_file.c @@ -210,21 +210,21 @@ ktfile_common_resolve(krb5_context context, const char *name, (*id)->ops = ops; if ((data = (krb5_ktfile_data *)malloc(sizeof(krb5_ktfile_data))) == NULL) { - krb5_xfree(*id); + free(*id); return(ENOMEM); } err = k5_mutex_init(&data->lock); if (err) { - krb5_xfree(data); - krb5_xfree(*id); + free(data); + free(*id); return err; } if ((data->name = strdup(name)) == NULL) { k5_mutex_destroy(&data->lock); - krb5_xfree(data); - krb5_xfree(*id); + free(data); + free(*id); return(ENOMEM); } @@ -259,12 +259,12 @@ krb5_ktfile_close(krb5_context context, krb5_keytab id) * This routine should undo anything done by krb5_ktfile_resolve(). */ { - krb5_xfree(KTFILENAME(id)); + free(KTFILENAME(id)); zap(KTFILEBUFP(id), BUFSIZ); k5_mutex_destroy(&((krb5_ktfile_data *)id->data)->lock); - krb5_xfree(id->data); + free(id->data); id->ops = 0; - krb5_xfree(id); + free(id); return (0); } @@ -533,7 +533,7 @@ krb5_ktfile_end_get(krb5_context context, krb5_keytab id, krb5_kt_cursor *cursor { krb5_error_code kerror; - krb5_xfree(*cursor); + free(*cursor); kerror = KTLOCK(id); if (kerror) return kerror; @@ -807,10 +807,10 @@ krb5_ktf_keytab_internalize(krb5_context kcontext, krb5_pointer *argp, krb5_octe if (kret) { if (keytab->data) { if (KTFILENAME(keytab)) - krb5_xfree(KTFILENAME(keytab)); - krb5_xfree(keytab->data); + free(KTFILENAME(keytab)); + free(keytab->data); } - krb5_xfree(keytab); + free(keytab); } else { *buffer = bp; diff --git a/src/lib/krb5/keytab/kt_memory.c b/src/lib/krb5/keytab/kt_memory.c index 53d15edd8..1f7717187 100644 --- a/src/lib/krb5/keytab/kt_memory.c +++ b/src/lib/krb5/keytab/kt_memory.c @@ -167,7 +167,7 @@ void krb5int_mkt_finalize(void) { next_node = node->next; /* destroy the contents of node->keytab */ - krb5_xfree(KTNAME(node->keytab)); + free(KTNAME(node->keytab)); /* free the keytab entries */ for (cursor = KTLINK(node->keytab); cursor; cursor = next_cursor) { @@ -176,21 +176,21 @@ void krb5int_mkt_finalize(void) { * krb5_context since we know that the context isn't used by * krb5_kt_free_entry or krb5_free_principal. */ krb5_kt_free_entry(NULL, cursor->entry); - krb5_xfree(cursor->entry); - krb5_xfree(cursor); + free(cursor->entry); + free(cursor); } /* destroy the lock */ k5_mutex_destroy(&(((krb5_mkt_data *)node->keytab->data)->lock)); /* free the private data */ - krb5_xfree(node->keytab->data); + free(node->keytab->data); /* and the keytab */ - krb5_xfree(node->keytab); + free(node->keytab); /* and finally the node */ - krb5_xfree(node); + free(node); } } /* @@ -230,15 +230,15 @@ krb5_mkt_resolve(krb5_context context, const char *name, krb5_keytab *id) } if ((list->keytab = (krb5_keytab)malloc(sizeof(struct _krb5_kt))) == NULL) { - krb5_xfree(list); + free(list); err = ENOMEM; goto done; } list->keytab->ops = &krb5_mkt_ops; if ((data = (krb5_mkt_data *)malloc(sizeof(krb5_mkt_data))) == NULL) { - krb5_xfree(list->keytab); - krb5_xfree(list); + free(list->keytab); + free(list); err = ENOMEM; goto done; } @@ -246,17 +246,17 @@ krb5_mkt_resolve(krb5_context context, const char *name, krb5_keytab *id) err = k5_mutex_init(&data->lock); if (err) { - krb5_xfree(data); - krb5_xfree(list->keytab); - krb5_xfree(list); + free(data); + free(list->keytab); + free(list); goto done; } if ((data->name = strdup(name)) == NULL) { k5_mutex_destroy(&data->lock); - krb5_xfree(data); - krb5_xfree(list->keytab); - krb5_xfree(list); + free(data); + free(list->keytab); + free(list); err = ENOMEM; goto done; } @@ -276,11 +276,11 @@ krb5_mkt_resolve(krb5_context context, const char *name, krb5_keytab *id) if (err) { k5_mutex_destroy(&data->lock); if (data && data->name) - krb5_xfree(data->name); - krb5_xfree(data); + free(data->name); + free(data); if (list && list->keytab) - krb5_xfree(list->keytab); - krb5_xfree(list); + free(list->keytab); + free(list); } else { KTREFCNT(*id)++; KTUNLOCK(*id); @@ -350,28 +350,28 @@ krb5_mkt_close(krb5_context context, krb5_keytab id) *listp = node->next; /* destroy the contents of node->keytab (aka id) */ - krb5_xfree(data->name); + free(data->name); /* free the keytab entries */ for (cursor = KTLINK(node->keytab); cursor; cursor = next_cursor) { next_cursor = cursor->next; krb5_kt_free_entry(context, cursor->entry); - krb5_xfree(cursor->entry); - krb5_xfree(cursor); + free(cursor->entry); + free(cursor); } /* destroy the lock */ k5_mutex_destroy(&(data->lock)); /* free the private data */ - krb5_xfree(data); + free(data); /* and the keytab */ - krb5_xfree(node->keytab); + free(node->keytab); /* and finally the node */ - krb5_xfree(node); + free(node); } #endif /* HEIMDAL_COMPATIBLE */ @@ -567,7 +567,7 @@ krb5_mkt_add(krb5_context context, krb5_keytab id, krb5_keytab_entry *entry) } cursor->entry = (krb5_keytab_entry *)malloc(sizeof(krb5_keytab_entry)); if (cursor->entry == NULL) { - krb5_xfree(cursor); + free(cursor); err = ENOMEM; goto done; } @@ -577,16 +577,16 @@ krb5_mkt_add(krb5_context context, krb5_keytab id, krb5_keytab_entry *entry) err = krb5_copy_keyblock_contents(context, &(entry->key), &(cursor->entry->key)); if (err) { - krb5_xfree(cursor->entry); - krb5_xfree(cursor); + free(cursor->entry); + free(cursor); goto done; } err = krb5_copy_principal(context, entry->principal, &(cursor->entry->principal)); if (err) { krb5_free_keyblock_contents(context, &(cursor->entry->key)); - krb5_xfree(cursor->entry); - krb5_xfree(cursor); + free(cursor->entry); + free(cursor); goto done; } @@ -635,9 +635,9 @@ krb5_mkt_remove(krb5_context context, krb5_keytab id, krb5_keytab_entry *entry) } krb5_kt_free_entry(context, (*pcursor)->entry); - krb5_xfree((*pcursor)->entry); + free((*pcursor)->entry); next = (*pcursor)->next; - krb5_xfree(*pcursor); + free(*pcursor); (*pcursor) = next; done: diff --git a/src/lib/krb5/keytab/kt_srvtab.c b/src/lib/krb5/keytab/kt_srvtab.c index 4555ca332..20ea3d755 100644 --- a/src/lib/krb5/keytab/kt_srvtab.c +++ b/src/lib/krb5/keytab/kt_srvtab.c @@ -123,14 +123,14 @@ krb5_ktsrvtab_resolve(krb5_context context, const char *name, krb5_keytab *id) (*id)->ops = &krb5_kts_ops; data = (krb5_ktsrvtab_data *)malloc(sizeof(krb5_ktsrvtab_data)); if (data == NULL) { - krb5_xfree(*id); + free(*id); return(ENOMEM); } data->name = strdup(name); if (data->name == NULL) { - krb5_xfree(data); - krb5_xfree(*id); + free(data); + free(*id); return(ENOMEM); } @@ -156,10 +156,10 @@ krb5_ktsrvtab_close(krb5_context context, krb5_keytab id) * This routine should undo anything done by krb5_ktsrvtab_resolve(). */ { - krb5_xfree(KTFILENAME(id)); - krb5_xfree(id->data); + free(KTFILENAME(id)); + free(id->data); id->ops = 0; - krb5_xfree(id); + free(id); return (0); } @@ -307,7 +307,7 @@ krb5_ktsrvtab_get_next(krb5_context context, krb5_keytab id, krb5_keytab_entry * krb5_error_code KRB5_CALLCONV krb5_ktsrvtab_end_get(krb5_context context, krb5_keytab id, krb5_kt_cursor *cursor) { - krb5_xfree(*cursor); + free(*cursor); return krb5_ktsrvint_close(context, id); } diff --git a/src/lib/krb5/keytab/ktfr_entry.c b/src/lib/krb5/keytab/ktfr_entry.c index e04623254..9587efc63 100644 --- a/src/lib/krb5/keytab/ktfr_entry.c +++ b/src/lib/krb5/keytab/ktfr_entry.c @@ -39,7 +39,7 @@ krb5_free_keytab_entry_contents (krb5_context context, krb5_keytab_entry *entry) krb5_free_principal(context, entry->principal); if (entry->key.contents) { zap((char *)entry->key.contents, entry->key.length); - krb5_xfree(entry->key.contents); + free(entry->key.contents); } return 0; } diff --git a/src/lib/krb5/krb/auth_con.c b/src/lib/krb5/krb/auth_con.c index 7af96403f..40b3d95d0 100644 --- a/src/lib/krb5/krb/auth_con.c +++ b/src/lib/krb5/krb/auth_con.c @@ -12,7 +12,7 @@ actx_copy_addr(krb5_context context, const krb5_address *inad, krb5_address **ou return ENOMEM; *tmpad = *inad; if (!(tmpad->contents = (krb5_octet *)malloc(inad->length))) { - krb5_xfree(tmpad); + free(tmpad); return ENOMEM; } memcpy((char *)tmpad->contents, (char *)inad->contents, inad->length); @@ -63,7 +63,7 @@ krb5_auth_con_free(krb5_context context, krb5_auth_context auth_context) if (auth_context->rcache) krb5_rc_close(context, auth_context->rcache); if (auth_context->permitted_etypes) - krb5_xfree(auth_context->permitted_etypes); + free(auth_context->permitted_etypes); free(auth_context); return 0; } @@ -336,7 +336,7 @@ krb5_auth_con_setpermetypes(krb5_context context, krb5_auth_context auth_context return(ENOMEM); if (auth_context->permitted_etypes) - krb5_xfree(auth_context->permitted_etypes); + free(auth_context->permitted_etypes); auth_context->permitted_etypes = newpe; diff --git a/src/lib/krb5/krb/bld_pr_ext.c b/src/lib/krb5/krb/bld_pr_ext.c index c1e19ba17..befa0eee4 100644 --- a/src/lib/krb5/krb/bld_pr_ext.c +++ b/src/lib/krb5/krb/bld_pr_ext.c @@ -59,15 +59,15 @@ krb5_build_principal_ext(krb5_context context, krb5_principal * princ, return ENOMEM; princ_ret = (krb5_principal) malloc(sizeof(krb5_principal_data)); if (!princ_ret) { - krb5_xfree(princ_data); + free(princ_data); return ENOMEM; } princ_ret->data = princ_data; princ_ret->length = count; tmpdata = malloc(rlen+1); if (!tmpdata) { - krb5_xfree(princ_data); - krb5_xfree(princ_ret); + free(princ_data); + free(princ_ret); return ENOMEM; } krb5_princ_set_realm_length(context, princ_ret, rlen); @@ -94,10 +94,10 @@ krb5_build_principal_ext(krb5_context context, krb5_principal * princ, free_out: while (--i >= 0) - krb5_xfree(princ_data[i].data); - krb5_xfree(princ_data); - krb5_xfree(princ_ret); - krb5_xfree(tmpdata); + free(princ_data[i].data); + free(princ_data); + free(princ_ret); + free(tmpdata); va_end(ap); return ENOMEM; } diff --git a/src/lib/krb5/krb/bld_princ.c b/src/lib/krb5/krb/bld_princ.c index c7e996374..d3e0d294b 100644 --- a/src/lib/krb5/krb/bld_princ.c +++ b/src/lib/krb5/krb/bld_princ.c @@ -97,11 +97,11 @@ krb5int_build_principal_va(krb5_context context, if (data) { while (--count >= 0) { - krb5_xfree(data[count].data); + free(data[count].data); } - krb5_xfree(data); + free(data); } - krb5_xfree(r); + free(r); return retval; } @@ -140,7 +140,7 @@ krb5int_build_principal_alloc_va(krb5_context context, if (!retval) { *princ = p; } else { - krb5_xfree(p); + free(p); } return retval; @@ -165,7 +165,7 @@ krb5_build_principal_alloc_va(krb5_context context, if (!retval) { *princ = p; } else { - krb5_xfree(p); + free(p); } return retval; diff --git a/src/lib/krb5/krb/chpw.c b/src/lib/krb5/krb/chpw.c index f5f68d562..2e675a391 100644 --- a/src/lib/krb5/krb/chpw.c +++ b/src/lib/krb5/krb/chpw.c @@ -225,7 +225,7 @@ krb5int_rd_chpw_rep(krb5_context context, krb5_auth_context auth_context, cleanup: if (ap_rep.length) { - krb5_xfree(clearresult.data); + free(clearresult.data); } else { krb5_free_error(context, krberror); } diff --git a/src/lib/krb5/krb/conv_princ.c b/src/lib/krb5/krb/conv_princ.c index 60c811513..176b41e35 100644 --- a/src/lib/krb5/krb/conv_princ.c +++ b/src/lib/krb5/krb/conv_princ.c @@ -334,7 +334,7 @@ krb5_425_conv_principal(krb5_context context, const char *name, *cp = tolower((unsigned char) *cp); strncat(buf, ".", sizeof(buf) - 1 - strlen(buf)); strncat(buf, domain, sizeof(buf) - 1 - strlen(buf)); - krb5_xfree(domain); + free(domain); } instance = buf; } diff --git a/src/lib/krb5/krb/copy_addrs.c b/src/lib/krb5/krb/copy_addrs.c index 28f19facc..f3f75c33b 100644 --- a/src/lib/krb5/krb/copy_addrs.c +++ b/src/lib/krb5/krb/copy_addrs.c @@ -38,7 +38,7 @@ krb5_copy_addr(krb5_context context, const krb5_address *inad, krb5_address **ou return ENOMEM; *tmpad = *inad; if (!(tmpad->contents = (krb5_octet *)malloc(inad->length))) { - krb5_xfree(tmpad); + free(tmpad); return ENOMEM; } memcpy((char *)tmpad->contents, (char *)inad->contents, inad->length); diff --git a/src/lib/krb5/krb/copy_athctr.c b/src/lib/krb5/krb/copy_athctr.c index 4d23c8470..c356fbf78 100644 --- a/src/lib/krb5/krb/copy_athctr.c +++ b/src/lib/krb5/krb/copy_athctr.c @@ -41,24 +41,24 @@ krb5_copy_authenticator(krb5_context context, const krb5_authenticator *authfrom retval = krb5_copy_principal(context, authfrom->client, &tempto->client); if (retval) { - krb5_xfree(tempto); + free(tempto); return retval; } if (authfrom->checksum && (retval = krb5_copy_checksum(context, authfrom->checksum, &tempto->checksum))) { krb5_free_principal(context, tempto->client); - krb5_xfree(tempto); + free(tempto); return retval; } if (authfrom->subkey) { retval = krb5_copy_keyblock(context, authfrom->subkey, &tempto->subkey); if (retval) { - krb5_xfree(tempto->subkey); + free(tempto->subkey); krb5_free_checksum(context, tempto->checksum); krb5_free_principal(context, tempto->client); - krb5_xfree(tempto); + free(tempto); return retval; } } @@ -67,11 +67,11 @@ krb5_copy_authenticator(krb5_context context, const krb5_authenticator *authfrom retval = krb5_copy_authdata(context, authfrom->authorization_data, &tempto->authorization_data); if (retval) { - krb5_xfree(tempto->subkey); + free(tempto->subkey); krb5_free_checksum(context, tempto->checksum); krb5_free_principal(context, tempto->client); krb5_free_authdata(context, tempto->authorization_data); - krb5_xfree(tempto); + free(tempto); return retval; } } diff --git a/src/lib/krb5/krb/copy_auth.c b/src/lib/krb5/krb/copy_auth.c index cd27f72b5..9a94cdded 100644 --- a/src/lib/krb5/krb/copy_auth.c +++ b/src/lib/krb5/krb/copy_auth.c @@ -65,7 +65,7 @@ krb5_copy_authdatum(krb5_context context, const krb5_authdata *inad, krb5_authda return ENOMEM; *tmpad = *inad; if (!(tmpad->contents = (krb5_octet *)malloc(inad->length))) { - krb5_xfree(tmpad); + free(tmpad); return ENOMEM; } memcpy((char *)tmpad->contents, (char *)inad->contents, inad->length); diff --git a/src/lib/krb5/krb/copy_cksum.c b/src/lib/krb5/krb/copy_cksum.c index ce7eb7aa7..2bff2c36e 100644 --- a/src/lib/krb5/krb/copy_cksum.c +++ b/src/lib/krb5/krb/copy_cksum.c @@ -40,7 +40,7 @@ krb5_copy_checksum(krb5_context context, const krb5_checksum *ckfrom, krb5_check if (!(tempto->contents = (krb5_octet *)malloc(tempto->length))) { - krb5_xfree(tempto); + free(tempto); return ENOMEM; } memcpy((char *) tempto->contents, (char *) ckfrom->contents, diff --git a/src/lib/krb5/krb/copy_creds.c b/src/lib/krb5/krb/copy_creds.c index f011a03ce..e6fece383 100644 --- a/src/lib/krb5/krb/copy_creds.c +++ b/src/lib/krb5/krb/copy_creds.c @@ -81,13 +81,13 @@ krb5int_copy_creds_contents(krb5_context context, const krb5_creds *incred, if (retval) goto cleanaddrs; tempcred->ticket = *scratch; - krb5_xfree(scratch); + free(scratch); retval = krb5_copy_data(context, &incred->second_ticket, &scratch); if (retval) goto clearticket; tempcred->second_ticket = *scratch; - krb5_xfree(scratch); + free(scratch); retval = krb5_copy_authdata(context, incred->authdata,&tempcred->authdata); if (retval) @@ -104,7 +104,7 @@ krb5int_copy_creds_contents(krb5_context context, const krb5_creds *incred, cleanaddrs: krb5_free_addresses(context, tempcred->addresses); cleanblock: - krb5_xfree(tempcred->keyblock.contents); + free(tempcred->keyblock.contents); cleanserver: krb5_free_principal(context, tempcred->server); cleanclient: diff --git a/src/lib/krb5/krb/copy_data.c b/src/lib/krb5/krb/copy_data.c index ab419f28a..5ba90c6b9 100644 --- a/src/lib/krb5/krb/copy_data.c +++ b/src/lib/krb5/krb/copy_data.c @@ -48,7 +48,7 @@ krb5_copy_data(krb5_context context, const krb5_data *indata, krb5_data **outdat retval = krb5int_copy_data_contents(context, indata, tempdata); if (retval) { - krb5_xfree(tempdata); + free(tempdata); return retval; } diff --git a/src/lib/krb5/krb/copy_key.c b/src/lib/krb5/krb/copy_key.c index 1bb04c199..e7fc2772a 100644 --- a/src/lib/krb5/krb/copy_key.c +++ b/src/lib/krb5/krb/copy_key.c @@ -41,7 +41,7 @@ krb5_copy_keyblock(krb5_context context, const krb5_keyblock *from, krb5_keybloc return ENOMEM; *new_key = *from; if (!(new_key->contents = (krb5_octet *)malloc(new_key->length))) { - krb5_xfree(new_key); + free(new_key); return(ENOMEM); } memcpy((char *)new_key->contents, (char *)from->contents, diff --git a/src/lib/krb5/krb/copy_tick.c b/src/lib/krb5/krb/copy_tick.c index 43268e50f..76d8bcfac 100644 --- a/src/lib/krb5/krb/copy_tick.c +++ b/src/lib/krb5/krb/copy_tick.c @@ -41,13 +41,13 @@ krb5_copy_enc_tkt_part(krb5_context context, const krb5_enc_tkt_part *partfrom, retval = krb5_copy_keyblock(context, partfrom->session, &tempto->session); if (retval) { - krb5_xfree(tempto); + free(tempto); return retval; } retval = krb5_copy_principal(context, partfrom->client, &tempto->client); if (retval) { krb5_free_keyblock(context, tempto->session); - krb5_xfree(tempto); + free(tempto); return retval; } tempto->transited = partfrom->transited; @@ -59,7 +59,7 @@ krb5_copy_enc_tkt_part(krb5_context context, const krb5_enc_tkt_part *partfrom, if (!tempto->transited.tr_contents.data) { krb5_free_principal(context, tempto->client); krb5_free_keyblock(context, tempto->session); - krb5_xfree(tempto); + free(tempto); return ENOMEM; } memcpy((char *)tempto->transited.tr_contents.data, @@ -69,10 +69,10 @@ krb5_copy_enc_tkt_part(krb5_context context, const krb5_enc_tkt_part *partfrom, retval = krb5_copy_addresses(context, partfrom->caddrs, &tempto->caddrs); if (retval) { - krb5_xfree(tempto->transited.tr_contents.data); + free(tempto->transited.tr_contents.data); krb5_free_principal(context, tempto->client); krb5_free_keyblock(context, tempto->session); - krb5_xfree(tempto); + free(tempto); return retval; } if (partfrom->authorization_data) { @@ -80,10 +80,10 @@ krb5_copy_enc_tkt_part(krb5_context context, const krb5_enc_tkt_part *partfrom, &tempto->authorization_data); if (retval) { krb5_free_addresses(context, tempto->caddrs); - krb5_xfree(tempto->transited.tr_contents.data); + free(tempto->transited.tr_contents.data); krb5_free_principal(context, tempto->client); krb5_free_keyblock(context, tempto->session); - krb5_xfree(tempto); + free(tempto); return retval; } } @@ -103,22 +103,22 @@ krb5_copy_ticket(krb5_context context, const krb5_ticket *from, krb5_ticket **pt *tempto = *from; retval = krb5_copy_principal(context, from->server, &tempto->server); if (retval) { - krb5_xfree(tempto); + free(tempto); return retval; } retval = krb5_copy_data(context, &from->enc_part.ciphertext, &scratch); if (retval) { krb5_free_principal(context, tempto->server); - krb5_xfree(tempto); + free(tempto); return retval; } tempto->enc_part.ciphertext = *scratch; - krb5_xfree(scratch); + free(scratch); retval = krb5_copy_enc_tkt_part(context, from->enc_part2, &tempto->enc_part2); if (retval) { - krb5_xfree(tempto->enc_part.ciphertext.data); + free(tempto->enc_part.ciphertext.data); krb5_free_principal(context, tempto->server); - krb5_xfree(tempto); + free(tempto); return retval; } *pto = tempto; diff --git a/src/lib/krb5/krb/free_rtree.c b/src/lib/krb5/krb/free_rtree.c index 7914d3f23..035c3a821 100644 --- a/src/lib/krb5/krb/free_rtree.c +++ b/src/lib/krb5/krb/free_rtree.c @@ -37,5 +37,5 @@ krb5_free_realm_tree(krb5_context context, krb5_principal *realms) krb5_free_principal(context, *nrealms); nrealms++; } - krb5_xfree(realms); + free(realms); } diff --git a/src/lib/krb5/krb/fwd_tgt.c b/src/lib/krb5/krb/fwd_tgt.c index 2db2c9e00..ccaef4d88 100644 --- a/src/lib/krb5/krb/fwd_tgt.c +++ b/src/lib/krb5/krb/fwd_tgt.c @@ -181,7 +181,7 @@ retval = KRB5_FWD_BAD_PRINCIPAL; krb5_free_data(context, scratch); } else { *outbuf = *scratch; - krb5_xfree(scratch); + free(scratch); } errout: diff --git a/src/lib/krb5/krb/gc_via_tkt.c b/src/lib/krb5/krb/gc_via_tkt.c index c73c6d529..97e40bf3c 100644 --- a/src/lib/krb5/krb/gc_via_tkt.c +++ b/src/lib/krb5/krb/gc_via_tkt.c @@ -57,7 +57,7 @@ krb5_kdcrep2creds(krb5_context context, krb5_kdc_rep *pkdcrep, krb5_address *con if ((retval = krb5_copy_data(context, psectkt, &pdata))) goto cleanup; (*ppcreds)->second_ticket = *pdata; - krb5_xfree(pdata); + free(pdata); (*ppcreds)->ticket_flags = pkdcrep->enc_part2->flags; (*ppcreds)->times = pkdcrep->enc_part2->times; diff --git a/src/lib/krb5/krb/gen_subkey.c b/src/lib/krb5/krb/gen_subkey.c index 4d4e7be68..601ab739a 100644 --- a/src/lib/krb5/krb/gen_subkey.c +++ b/src/lib/krb5/krb/gen_subkey.c @@ -56,7 +56,7 @@ krb5_generate_subkey_extended(krb5_context context, return(ENOMEM); if ((retval = krb5_c_make_random_key(context, enctype, *subkey))) { - krb5_xfree(*subkey); + free(*subkey); return(retval); } diff --git a/src/lib/krb5/krb/get_creds.c b/src/lib/krb5/krb/get_creds.c index 6824a74b2..fff8b903b 100644 --- a/src/lib/krb5/krb/get_creds.c +++ b/src/lib/krb5/krb/get_creds.c @@ -128,7 +128,7 @@ krb5_get_credentials(krb5_context context, krb5_flags options, /* The caller is now responsible for cleaning up in_creds */ if ((retval = krb5_cc_retrieve_cred(context, ccache, fields, &mcreds, ncreds))) { - krb5_xfree(ncreds); + free(ncreds); ncreds = in_creds; } else { *out_creds = ncreds; @@ -311,7 +311,7 @@ krb5_validate_or_renew_creds(krb5_context context, krb5_creds *creds, /* ick. copy the struct contents, free the container */ if (out_creds) { *creds = *out_creds; - krb5_xfree(out_creds); + free(out_creds); } cleanup: diff --git a/src/lib/krb5/krb/get_in_tkt.c b/src/lib/krb5/krb/get_in_tkt.c index 8a8a9b3c0..52d17e0bb 100644 --- a/src/lib/krb5/krb/get_in_tkt.c +++ b/src/lib/krb5/krb/get_in_tkt.c @@ -272,7 +272,7 @@ decrypt_as_reply(krb5_context context, retval = (*key_proc)(context, as_reply->enc_part.enctype, &salt, keyseed, &decrypt_key); - krb5_xfree(salt.data); + free(salt.data); if (retval) goto cleanup; } @@ -409,7 +409,7 @@ stash_as_reply(krb5_context context, goto cleanup; creds->ticket = *packet; - krb5_xfree(packet); + free(packet); /* store it in the ccache! */ if (ccache) @@ -430,12 +430,12 @@ cleanup: if (creds->keyblock.contents) { memset((char *)creds->keyblock.contents, 0, creds->keyblock.length); - krb5_xfree(creds->keyblock.contents); + free(creds->keyblock.contents); creds->keyblock.contents = 0; creds->keyblock.length = 0; } if (creds->ticket.data) { - krb5_xfree(creds->ticket.data); + free(creds->ticket.data); creds->ticket.data = 0; } if (creds->addresses) { @@ -1489,7 +1489,7 @@ cleanup: krb5_free_keyblock_contents(context, &as_key); if (salt.data && (!(options && (options->flags & KRB5_GET_INIT_CREDS_OPT_SALT)))) - krb5_xfree(salt.data); + free(salt.data); krb5_free_data_contents(context, &s2kparams); if (as_reply) *as_reply = local_as_reply; diff --git a/src/lib/krb5/krb/gic_keytab.c b/src/lib/krb5/krb/gic_keytab.c index 7e60b2d19..923579487 100644 --- a/src/lib/krb5/krb/gic_keytab.c +++ b/src/lib/krb5/krb/gic_keytab.c @@ -69,7 +69,7 @@ krb5_get_as_key_keytab( /* again, krb5's memory management is lame... */ *as_key = *kt_key; - krb5_xfree(kt_key); + free(kt_key); (void) krb5_kt_free_entry(context, &kt_ent); diff --git a/src/lib/krb5/krb/gic_pwd.c b/src/lib/krb5/krb/gic_pwd.c index 716d3cc43..4174f4e66 100644 --- a/src/lib/krb5/krb/gic_pwd.c +++ b/src/lib/krb5/krb/gic_pwd.c @@ -76,7 +76,7 @@ krb5_get_as_key_password( params->data?params:NULL, as_key); if (defsalt.length) - krb5_xfree(defsalt.data); + free(defsalt.data); return(ret); } @@ -274,7 +274,7 @@ krb5_get_init_creds_password(krb5_context context, /* the change succeeded. go on */ if (result_code == 0) { - krb5_xfree(result_string.data); + free(result_string.data); break; } @@ -283,7 +283,7 @@ krb5_get_init_creds_password(krb5_context context, ret = KRB5_CHPW_FAIL; if (result_code != KRB5_KPASSWD_SOFTERROR) { - krb5_xfree(result_string.data); + free(result_string.data); goto cleanup; } @@ -301,8 +301,8 @@ krb5_get_init_creds_password(krb5_context context, (int) result_string.length, result_string.data ? result_string.data : ""); - krb5_xfree(code_string.data); - krb5_xfree(result_string.data); + free(code_string.data); + free(result_string.data); } } diff --git a/src/lib/krb5/krb/kfree.c b/src/lib/krb5/krb/kfree.c index 9e5e19274..6bf20c5a9 100644 --- a/src/lib/krb5/krb/kfree.c +++ b/src/lib/krb5/krb/kfree.c @@ -59,8 +59,8 @@ void KRB5_CALLCONV krb5_free_address(krb5_context context, krb5_address *val) { if (val->contents) - krb5_xfree(val->contents); - krb5_xfree(val); + free(val->contents); + free(val); } void KRB5_CALLCONV @@ -70,10 +70,10 @@ krb5_free_addresses(krb5_context context, krb5_address **val) for (temp = val; *temp; temp++) { if ((*temp)->contents) - krb5_xfree((*temp)->contents); - krb5_xfree(*temp); + free((*temp)->contents); + free(*temp); } - krb5_xfree(val); + free(val); } @@ -81,8 +81,8 @@ void KRB5_CALLCONV krb5_free_ap_rep(krb5_context context, register krb5_ap_rep *val) { if (val->enc_part.ciphertext.data) - krb5_xfree(val->enc_part.ciphertext.data); - krb5_xfree(val); + free(val->enc_part.ciphertext.data); + free(val); } void KRB5_CALLCONV @@ -91,8 +91,8 @@ krb5_free_ap_req(krb5_context context, register krb5_ap_req *val) if (val->ticket) krb5_free_ticket(context, val->ticket); if (val->authenticator.ciphertext.data) - krb5_xfree(val->authenticator.ciphertext.data); - krb5_xfree(val); + free(val->authenticator.ciphertext.data); + free(val); } void KRB5_CALLCONV @@ -100,7 +100,7 @@ krb5_free_ap_rep_enc_part(krb5_context context, krb5_ap_rep_enc_part *val) { if (val->subkey) krb5_free_keyblock(context, val->subkey); - krb5_xfree(val); + free(val); } void KRB5_CALLCONV @@ -131,31 +131,31 @@ krb5_free_authdata(krb5_context context, krb5_authdata **val) for (temp = val; *temp; temp++) { if ((*temp)->contents) - krb5_xfree((*temp)->contents); - krb5_xfree(*temp); + free((*temp)->contents); + free(*temp); } - krb5_xfree(val); + free(val); } void KRB5_CALLCONV krb5_free_authenticator(krb5_context context, krb5_authenticator *val) { krb5_free_authenticator_contents(context, val); - krb5_xfree(val); + free(val); } void KRB5_CALLCONV krb5_free_checksum(krb5_context context, register krb5_checksum *val) { krb5_free_checksum_contents(context, val); - krb5_xfree(val); + free(val); } void KRB5_CALLCONV krb5_free_checksum_contents(krb5_context context, register krb5_checksum *val) { if (val->contents) { - krb5_xfree(val->contents); + free(val->contents); val->contents = 0; } } @@ -166,8 +166,8 @@ krb5_free_cred(krb5_context context, register krb5_cred *val) if (val->tickets) krb5_free_tickets(context, val->tickets); if (val->enc_part.ciphertext.data) - krb5_xfree(val->enc_part.ciphertext.data); - krb5_xfree(val); + free(val->enc_part.ciphertext.data); + free(val); } /* @@ -188,15 +188,15 @@ krb5_free_cred_contents(krb5_context context, krb5_creds *val) } if (val->keyblock.contents) { memset((char *)val->keyblock.contents, 0, val->keyblock.length); - krb5_xfree(val->keyblock.contents); + free(val->keyblock.contents); val->keyblock.contents = 0; } if (val->ticket.data) { - krb5_xfree(val->ticket.data); + free(val->ticket.data); val->ticket.data = 0; } if (val->second_ticket.data) { - krb5_xfree(val->second_ticket.data); + free(val->second_ticket.data); val->second_ticket.data = 0; } if (val->addresses) { @@ -233,9 +233,9 @@ krb5_free_cred_enc_part(krb5_context context, register krb5_cred_enc_part *val) krb5_free_principal(context, (*temp)->server); if ((*temp)->caddrs) krb5_free_addresses(context, (*temp)->caddrs); - krb5_xfree((*temp)); + free((*temp)); } - krb5_xfree(val->ticket_info); + free(val->ticket_info); val->ticket_info = 0; } } @@ -245,7 +245,7 @@ void KRB5_CALLCONV krb5_free_creds(krb5_context context, krb5_creds *val) { krb5_free_cred_contents(context, val); - krb5_xfree(val); + free(val); } @@ -253,15 +253,15 @@ void KRB5_CALLCONV krb5_free_data(krb5_context context, krb5_data *val) { if (val->data) - krb5_xfree(val->data); - krb5_xfree(val); + free(val->data); + free(val); } void KRB5_CALLCONV krb5_free_data_contents(krb5_context context, krb5_data *val) { if (val->data) { - krb5_xfree(val->data); + free(val->data); val->data = 0; } } @@ -291,7 +291,7 @@ krb5_free_enc_kdc_rep_part(krb5_context context, register krb5_enc_kdc_rep_part krb5_free_principal(context, val->server); if (val->caddrs) krb5_free_addresses(context, val->caddrs); - krb5_xfree(val); + free(val); } void KRB5_CALLCONV @@ -302,12 +302,12 @@ krb5_free_enc_tkt_part(krb5_context context, krb5_enc_tkt_part *val) if (val->client) krb5_free_principal(context, val->client); if (val->transited.tr_contents.data) - krb5_xfree(val->transited.tr_contents.data); + free(val->transited.tr_contents.data); if (val->caddrs) krb5_free_addresses(context, val->caddrs); if (val->authorization_data) krb5_free_authdata(context, val->authorization_data); - krb5_xfree(val); + free(val); } @@ -319,10 +319,10 @@ krb5_free_error(krb5_context context, register krb5_error *val) if (val->server) krb5_free_principal(context, val->server); if (val->text.data) - krb5_xfree(val->text.data); + free(val->text.data); if (val->e_data.data) - krb5_xfree(val->e_data.data); - krb5_xfree(val); + free(val->e_data.data); + free(val); } void KRB5_CALLCONV @@ -335,10 +335,10 @@ krb5_free_kdc_rep(krb5_context context, krb5_kdc_rep *val) if (val->ticket) krb5_free_ticket(context, val->ticket); if (val->enc_part.ciphertext.data) - krb5_xfree(val->enc_part.ciphertext.data); + free(val->enc_part.ciphertext.data); if (val->enc_part2) krb5_free_enc_kdc_rep_part(context, val->enc_part2); - krb5_xfree(val); + free(val); } @@ -352,16 +352,16 @@ krb5_free_kdc_req(krb5_context context, krb5_kdc_req *val) if (val->server) krb5_free_principal(context, val->server); if (val->ktype) - krb5_xfree(val->ktype); + free(val->ktype); if (val->addresses) krb5_free_addresses(context, val->addresses); if (val->authorization_data.ciphertext.data) - krb5_xfree(val->authorization_data.ciphertext.data); + free(val->authorization_data.ciphertext.data); if (val->unenc_authdata) krb5_free_authdata(context, val->unenc_authdata); if (val->second_ticket) krb5_free_tickets(context, val->second_ticket); - krb5_xfree(val); + free(val); } void KRB5_CALLCONV @@ -384,8 +384,8 @@ krb5_free_last_req(krb5_context context, krb5_last_req_entry **val) register krb5_last_req_entry **temp; for (temp = val; *temp; temp++) - krb5_xfree(*temp); - krb5_xfree(val); + free(*temp); + free(val); } void KRB5_CALLCONV @@ -395,10 +395,10 @@ krb5_free_pa_data(krb5_context context, krb5_pa_data **val) for (temp = val; *temp; temp++) { if ((*temp)->contents) - krb5_xfree((*temp)->contents); - krb5_xfree(*temp); + free((*temp)->contents); + free(*temp); } - krb5_xfree(val); + free(val); } void KRB5_CALLCONV @@ -413,31 +413,31 @@ krb5_free_principal(krb5_context context, krb5_principal val) i = krb5_princ_size(context, val); while(--i >= 0) free(krb5_princ_component(context, val, i)->data); - krb5_xfree(val->data); + free(val->data); } if (val->realm.data) - krb5_xfree(val->realm.data); - krb5_xfree(val); + free(val->realm.data); + free(val); } void KRB5_CALLCONV krb5_free_priv(krb5_context context, register krb5_priv *val) { if (val->enc_part.ciphertext.data) - krb5_xfree(val->enc_part.ciphertext.data); - krb5_xfree(val); + free(val->enc_part.ciphertext.data); + free(val); } void KRB5_CALLCONV krb5_free_priv_enc_part(krb5_context context, register krb5_priv_enc_part *val) { if (val->user_data.data) - krb5_xfree(val->user_data.data); + free(val->user_data.data); if (val->r_address) krb5_free_address(context, val->r_address); if (val->s_address) krb5_free_address(context, val->s_address); - krb5_xfree(val); + free(val); } void KRB5_CALLCONV @@ -445,7 +445,7 @@ krb5_free_pwd_data(krb5_context context, krb5_pwd_data *val) { if (val->element) krb5_free_pwd_sequences(context, val->element); - krb5_xfree(val); + free(val); } @@ -463,9 +463,9 @@ krb5_free_pwd_sequences(krb5_context context, passwd_phrase_element **val) krb5_free_data(context, (*temp)->phrase); (*temp)->phrase = 0; } - krb5_xfree(*temp); + free(*temp); } - krb5_xfree(val); + free(val); } @@ -473,14 +473,14 @@ void KRB5_CALLCONV krb5_free_safe(krb5_context context, register krb5_safe *val) { if (val->user_data.data) - krb5_xfree(val->user_data.data); + free(val->user_data.data); if (val->r_address) krb5_free_address(context, val->r_address); if (val->s_address) krb5_free_address(context, val->s_address); if (val->checksum) krb5_free_checksum(context, val->checksum); - krb5_xfree(val); + free(val); } @@ -490,10 +490,10 @@ krb5_free_ticket(krb5_context context, krb5_ticket *val) if (val->server) krb5_free_principal(context, val->server); if (val->enc_part.ciphertext.data) - krb5_xfree(val->enc_part.ciphertext.data); + free(val->enc_part.ciphertext.data); if (val->enc_part2) krb5_free_enc_tkt_part(context, val->enc_part2); - krb5_xfree(val); + free(val); } void KRB5_CALLCONV @@ -503,7 +503,7 @@ krb5_free_tickets(krb5_context context, krb5_ticket **val) for (temp = val; *temp; temp++) krb5_free_ticket(context, *temp); - krb5_xfree(val); + free(val); } @@ -513,7 +513,7 @@ krb5_free_tgt_creds(krb5_context context, krb5_creds **tgts) register krb5_creds **tgtpp; for (tgtpp = tgts; *tgtpp; tgtpp++) krb5_free_creds(context, *tgtpp); - krb5_xfree(tgts); + free(tgts); } void KRB5_CALLCONV @@ -523,14 +523,14 @@ krb5_free_tkt_authent(krb5_context context, krb5_tkt_authent *val) krb5_free_ticket(context, val->ticket); if (val->authenticator) krb5_free_authenticator(context, val->authenticator); - krb5_xfree(val); + free(val); } void KRB5_CALLCONV krb5_free_unparsed_name(krb5_context context, char *val) { if (val) - krb5_xfree(val); + free(val); } void KRB5_CALLCONV @@ -539,7 +539,7 @@ krb5_free_sam_challenge(krb5_context ctx, krb5_sam_challenge *sc) if (!sc) return; krb5_free_sam_challenge_contents(ctx, sc); - krb5_xfree(sc); + free(sc); } void KRB5_CALLCONV @@ -548,7 +548,7 @@ krb5_free_sam_challenge_2(krb5_context ctx, krb5_sam_challenge_2 *sc2) if (!sc2) return; krb5_free_sam_challenge_2_contents(ctx, sc2); - krb5_xfree(sc2); + free(sc2); } void KRB5_CALLCONV @@ -569,7 +569,7 @@ krb5_free_sam_challenge_contents(krb5_context ctx, krb5_sam_challenge *sc) if (sc->sam_pk_for_sad.data) krb5_free_data_contents(ctx, &sc->sam_pk_for_sad); if (sc->sam_cksum.contents) { - krb5_xfree(sc->sam_cksum.contents); + free(sc->sam_cksum.contents); sc->sam_cksum.contents = 0; } } @@ -590,7 +590,7 @@ krb5_free_sam_challenge_2_contents(krb5_context ctx, krb5_free_checksum(ctx, *cksump); cksump++; } - krb5_xfree(sc2->sam_cksum); + free(sc2->sam_cksum); sc2->sam_cksum = 0; } } @@ -602,7 +602,7 @@ krb5_free_sam_challenge_2_body(krb5_context ctx, if (!sc2) return; krb5_free_sam_challenge_2_body_contents(ctx, sc2); - krb5_xfree(sc2); + free(sc2); } void KRB5_CALLCONV @@ -631,7 +631,7 @@ krb5_free_sam_response(krb5_context ctx, krb5_sam_response *sr) if (!sr) return; krb5_free_sam_response_contents(ctx, sr); - krb5_xfree(sr); + free(sr); } void KRB5_CALLCONV @@ -640,7 +640,7 @@ krb5_free_sam_response_2(krb5_context ctx, krb5_sam_response_2 *sr2) if (!sr2) return; krb5_free_sam_response_2_contents(ctx, sr2); - krb5_xfree(sr2); + free(sr2); } void KRB5_CALLCONV @@ -674,7 +674,7 @@ krb5_free_predicted_sam_response(krb5_context ctx, if (!psr) return; krb5_free_predicted_sam_response_contents(ctx, psr); - krb5_xfree(psr); + free(psr); } void KRB5_CALLCONV @@ -700,7 +700,7 @@ krb5_free_enc_sam_response_enc(krb5_context ctx, if (!esre) return; krb5_free_enc_sam_response_enc_contents(ctx, esre); - krb5_xfree(esre); + free(esre); } void KRB5_CALLCONV @@ -710,7 +710,7 @@ krb5_free_enc_sam_response_enc_2(krb5_context ctx, if (!esre2) return; krb5_free_enc_sam_response_enc_2_contents(ctx, esre2); - krb5_xfree(esre2); + free(esre2); } void KRB5_CALLCONV @@ -738,7 +738,7 @@ krb5_free_pa_enc_ts(krb5_context ctx, krb5_pa_enc_ts *pa_enc_ts) { if (!pa_enc_ts) return; - krb5_xfree(pa_enc_ts); + free(pa_enc_ts); } void KRB5_CALLCONV @@ -752,7 +752,7 @@ krb5_free_pa_for_user(krb5_context context, krb5_pa_for_user *req) } krb5_free_checksum_contents(context, &req->cksum); krb5_free_data_contents(context, &req->auth_package); - krb5_xfree(req); + free(req); } void KRB5_CALLCONV @@ -774,7 +774,7 @@ krb5_free_pa_server_referral_data(krb5_context context, ref->requested_principal_name = NULL; } krb5_free_checksum_contents(context, &ref->rep_cksum); - krb5_xfree(ref); + free(ref); } void KRB5_CALLCONV @@ -787,7 +787,7 @@ krb5_free_pa_svr_referral_data(krb5_context context, krb5_free_principal(context, ref->principal); ref->principal = NULL; } - krb5_xfree(ref); + free(ref); } void KRB5_CALLCONV @@ -796,7 +796,7 @@ krb5_free_pa_pac_req(krb5_context context, { if (req == NULL) return; - krb5_xfree(req); + free(req); } void KRB5_CALLCONV @@ -805,7 +805,7 @@ krb5_free_etype_list(krb5_context context, { if (etypes != NULL) { if (etypes->etypes != NULL) - krb5_xfree(etypes->etypes); - krb5_xfree(etypes); + free(etypes->etypes); + free(etypes); } } diff --git a/src/lib/krb5/krb/mk_cred.c b/src/lib/krb5/krb/mk_cred.c index a63b07ac6..561886825 100644 --- a/src/lib/krb5/krb/mk_cred.c +++ b/src/lib/krb5/krb/mk_cred.c @@ -38,7 +38,7 @@ encrypt_credencpart(krb5_context context, krb5_cred_enc_part *pcredpart, if (pkeyblock == NULL) { pencdata->ciphertext.data = scratch->data; pencdata->ciphertext.length = scratch->length; - krb5_xfree(scratch); + free(scratch); return 0; } @@ -263,10 +263,10 @@ krb5_mk_ncred(krb5_context context, krb5_auth_context auth_context, replay.ctime = replaydata.timestamp; if ((retval = krb5_rc_store(context, auth_context->rcache, &replay))) { /* should we really error out here? XXX */ - krb5_xfree(replay.client); + free(replay.client); goto error; } - krb5_xfree(replay.client); + free(replay.client); } /* Encode creds structure */ diff --git a/src/lib/krb5/krb/mk_error.c b/src/lib/krb5/krb/mk_error.c index 819d29dde..75cdc9b5b 100644 --- a/src/lib/krb5/krb/mk_error.c +++ b/src/lib/krb5/krb/mk_error.c @@ -47,6 +47,6 @@ krb5_mk_error(krb5_context context, const krb5_error *dec_err, if ((retval = encode_krb5_error(dec_err, &new_enc_err))) return(retval); *enc_err = *new_enc_err; - krb5_xfree(new_enc_err); + free(new_enc_err); return 0; } diff --git a/src/lib/krb5/krb/mk_priv.c b/src/lib/krb5/krb/mk_priv.c index 2a56bd097..e626872a0 100644 --- a/src/lib/krb5/krb/mk_priv.c +++ b/src/lib/krb5/krb/mk_priv.c @@ -91,7 +91,7 @@ krb5_mk_priv_basic(krb5_context context, const krb5_data *userdata, goto clean_encpart; *outbuf = *scratch2; - krb5_xfree(scratch2); + free(scratch2); retval = 0; clean_encpart: @@ -209,7 +209,7 @@ krb5_mk_priv(krb5_context context, krb5_auth_context auth_context, if ((retval = krb5_gen_replay_name(context, auth_context->local_addr, "_priv", &replay.client))) { - krb5_xfree(outbuf); + free(outbuf); goto error; } @@ -219,10 +219,10 @@ krb5_mk_priv(krb5_context context, krb5_auth_context auth_context, replay.ctime = replaydata.timestamp; if ((retval = krb5_rc_store(context, auth_context->rcache, &replay))) { /* should we really error out here? XXX */ - krb5_xfree(replay.client); + free(replay.client); goto error; } - krb5_xfree(replay.client); + free(replay.client); } return 0; diff --git a/src/lib/krb5/krb/mk_rep.c b/src/lib/krb5/krb/mk_rep.c index ee4f34ed2..29155b6e1 100644 --- a/src/lib/krb5/krb/mk_rep.c +++ b/src/lib/krb5/krb/mk_rep.c @@ -122,7 +122,7 @@ k5_mk_rep(krb5_context context, krb5_auth_context auth_context, if (!(retval = encode_krb5_ap_rep(&reply, &toutbuf))) { *outbuf = *toutbuf; - krb5_xfree(toutbuf); + free(toutbuf); } memset(reply.enc_part.ciphertext.data, 0, reply.enc_part.ciphertext.length); diff --git a/src/lib/krb5/krb/mk_req_ext.c b/src/lib/krb5/krb/mk_req_ext.c index 0d24017ee..2d700aec8 100644 --- a/src/lib/krb5/krb/mk_req_ext.c +++ b/src/lib/krb5/krb/mk_req_ext.c @@ -261,7 +261,7 @@ krb5_mk_req_extended(krb5_context context, krb5_auth_context *auth_context, goto cleanup_cksum; *outbuf = *toutbuf; - krb5_xfree(toutbuf); + free(toutbuf); cleanup_cksum: if (checksump && checksump->checksum_type != 0x8003) @@ -270,7 +270,7 @@ cleanup_cksum: cleanup: if (desired_etypes && desired_etypes != (*auth_context)->permitted_etypes) - krb5_xfree(desired_etypes); + free(desired_etypes); if (request.ticket) krb5_free_ticket(context, request.ticket); if (request.authenticator.ciphertext.data) { @@ -280,8 +280,8 @@ cleanup: } if (scratch) { memset(scratch->data, 0, scratch->length); - krb5_xfree(scratch->data); - krb5_xfree(scratch); + free(scratch->data); + free(scratch); } return retval; } @@ -401,7 +401,7 @@ make_etype_list(krb5_context context, adata[i]->ad_type = KRB5_AUTHDATA_IF_RELEVANT; adata[i]->length = ad_if_relevant->length; adata[i]->contents = (krb5_octet *)ad_if_relevant->data; - krb5_xfree(ad_if_relevant); /* contents owned by adata[i] */ + free(ad_if_relevant); /* contents owned by adata[i] */ adata[i + 1] = NULL; diff --git a/src/lib/krb5/krb/mk_safe.c b/src/lib/krb5/krb/mk_safe.c index 01abfab96..c2937ea03 100644 --- a/src/lib/krb5/krb/mk_safe.c +++ b/src/lib/krb5/krb/mk_safe.c @@ -98,11 +98,11 @@ krb5_mk_safe_basic(krb5_context context, const krb5_data *userdata, goto cleanup_checksum; } *outbuf = *scratch2; - krb5_xfree(scratch2); + free(scratch2); retval = 0; cleanup_checksum: - krb5_xfree(safe_checksum.contents); + free(safe_checksum.contents); memset((char *)scratch1->data, 0, scratch1->length); krb5_free_data(context, scratch1); @@ -234,7 +234,7 @@ krb5_mk_safe(krb5_context context, krb5_auth_context auth_context, if ((retval = krb5_gen_replay_name(context, auth_context->local_addr, "_safe", &replay.client))) { - krb5_xfree(outbuf); + free(outbuf); goto error; } @@ -244,10 +244,10 @@ krb5_mk_safe(krb5_context context, krb5_auth_context auth_context, replay.ctime = replaydata.timestamp; if ((retval = krb5_rc_store(context, auth_context->rcache, &replay))) { /* should we really error out here? XXX */ - krb5_xfree(outbuf); + free(outbuf); goto error; } - krb5_xfree(replay.client); + free(replay.client); } return 0; diff --git a/src/lib/krb5/krb/parse.c b/src/lib/krb5/krb/parse.c index 87548097a..d55a488e3 100644 --- a/src/lib/krb5/krb/parse.c +++ b/src/lib/krb5/krb/parse.c @@ -148,7 +148,7 @@ k5_parse_name(krb5_context context, const char *name, } principal->data = (krb5_data *) malloc(sizeof(krb5_data) * components); if (principal->data == NULL) { - krb5_xfree((char *)principal); + free((char *)principal); return ENOMEM; } principal->length = components; @@ -162,15 +162,15 @@ k5_parse_name(krb5_context context, const char *name, if (flags & KRB5_PRINCIPAL_PARSE_REQUIRE_REALM) { krb5_set_error_message(context, KRB5_PARSE_MALFORMED, "Principal %s is missing required realm", name); - krb5_xfree(principal->data); - krb5_xfree(principal); + free(principal->data); + free(principal); return KRB5_PARSE_MALFORMED; } if (!default_realm && (flags & KRB5_PRINCIPAL_PARSE_NO_REALM) == 0) { retval = krb5_get_default_realm(context, &default_realm); if (retval) { - krb5_xfree(principal->data); - krb5_xfree((char *)principal); + free(principal->data); + free((char *)principal); return(retval); } default_realm_size = strlen(default_realm); @@ -179,8 +179,8 @@ k5_parse_name(krb5_context context, const char *name, } else if (flags & KRB5_PRINCIPAL_PARSE_NO_REALM) { krb5_set_error_message(context, KRB5_PARSE_MALFORMED, "Principal %s has realm present", name); - krb5_xfree(principal->data); - krb5_xfree(principal); + free(principal->data); + free(principal); return KRB5_PARSE_MALFORMED; } @@ -237,9 +237,9 @@ k5_parse_name(krb5_context context, const char *name, */ tmpdata = malloc(realmsize + 1); if (tmpdata == 0) { - krb5_xfree(principal->data); - krb5_xfree(principal); - krb5_xfree(default_realm); + free(principal->data); + free(principal); + free(default_realm); return ENOMEM; } krb5_princ_set_realm_length(context, principal, realmsize); @@ -249,11 +249,11 @@ k5_parse_name(krb5_context context, const char *name, malloc(krb5_princ_component(context, principal, i)->length + 1); if (tmpdata2 == NULL) { for (i--; i >= 0; i--) - krb5_xfree(krb5_princ_component(context, principal, i)->data); - krb5_xfree(krb5_princ_realm(context, principal)->data); - krb5_xfree(principal->data); - krb5_xfree(principal); - krb5_xfree(default_realm); + free(krb5_princ_component(context, principal, i)->data); + free(krb5_princ_realm(context, principal)->data); + free(principal->data); + free(principal); + free(default_realm); return(ENOMEM); } krb5_princ_component(context, principal, i)->data = tmpdata2; @@ -321,7 +321,7 @@ k5_parse_name(krb5_context context, const char *name, *nprincipal = principal; if (default_realm != NULL) - krb5_xfree(default_realm); + free(default_realm); return(0); } diff --git a/src/lib/krb5/krb/preauth.c b/src/lib/krb5/krb/preauth.c index 11574116a..2ef38c2c5 100644 --- a/src/lib/krb5/krb/preauth.c +++ b/src/lib/krb5/krb/preauth.c @@ -227,7 +227,7 @@ cleanup: if (etype_info) krb5_free_etype_info(context, etype_info); if (f_salt) - krb5_xfree(salt.data); + free(salt.data); if (send_pa_list) krb5_free_pa_data(context, send_pa_list); if (def_enc_key) @@ -314,7 +314,7 @@ obtain_enc_ts_padata(krb5_context context, krb5_pa_data *in_padata, krb5_etype_i *out_padata = pa; - krb5_xfree(scratch); + free(scratch); scratch = 0; retval = 0; @@ -323,7 +323,7 @@ cleanup: if (scratch) krb5_free_data(context, scratch); if (enc_data.ciphertext.data) - krb5_xfree(enc_data.ciphertext.data); + free(enc_data.ciphertext.data); return retval; } @@ -383,7 +383,7 @@ sam_get_pass_from_user(krb5_context context, krb5_etype_info etype_info, git_key /* we don't keep the new password, just the key... */ retval = (*key_proc)(context, enctype, 0, (krb5_const_pointer)&newpw, new_enc_key); - krb5_xfree(newpw.data); + free(newpw.data); } krb5_default_pwd_prompt1 = oldprompt; return retval; @@ -569,6 +569,6 @@ cleanup: if (scratch) krb5_free_data(context, scratch); if (sam_challenge) - krb5_xfree(sam_challenge); + free(sam_challenge); return retval; } diff --git a/src/lib/krb5/krb/preauth2.c b/src/lib/krb5/krb/preauth2.c index bcb15d663..a6182d73f 100644 --- a/src/lib/krb5/krb/preauth2.c +++ b/src/lib/krb5/krb/preauth2.c @@ -676,13 +676,13 @@ krb5_error_code pa_enc_timestamp(krb5_context context, krb5_free_data(context, tmp); if (ret) { - krb5_xfree(enc_data.ciphertext.data); + free(enc_data.ciphertext.data); return(ret); } ret = encode_krb5_enc_data(&enc_data, &tmp); - krb5_xfree(enc_data.ciphertext.data); + free(enc_data.ciphertext.data); if (ret) return(ret); @@ -699,7 +699,7 @@ krb5_error_code pa_enc_timestamp(krb5_context context, *out_padata = pa; - krb5_xfree(tmp); + free(tmp); return(0); } @@ -893,7 +893,7 @@ krb5_error_code pa_sam(krb5_context context, (krb5_data *)gak_data, salt, as_key); if (defsalt.length) - krb5_xfree(defsalt.data); + free(defsalt.data); if (ret) { krb5_free_sam_challenge(context, sam_challenge); @@ -937,7 +937,7 @@ krb5_error_code pa_sam(krb5_context context, &response_data, salt, as_key); if (defsalt.length) - krb5_xfree(defsalt.data); + free(defsalt.data); if (ret) { krb5_free_sam_challenge(context, sam_challenge); @@ -958,7 +958,7 @@ krb5_error_code pa_sam(krb5_context context, sam_response.sam_type = sam_challenge->sam_type; sam_response.magic = KV5M_SAM_RESPONSE; - krb5_xfree(sam_challenge); + free(sam_challenge); /* encode the encoded part of the response */ if ((ret = encode_krb5_enc_sam_response_enc(&enc_sam_response_enc, @@ -991,7 +991,7 @@ krb5_error_code pa_sam(krb5_context context, *out_padata = pa; - krb5_xfree(scratch); + free(scratch); return(0); } @@ -1458,7 +1458,7 @@ krb5_error_code pa_sam_2(krb5_context context, if (retval) { krb5_free_sam_challenge_2(context, sc2); krb5_free_sam_challenge_2_body(context, sc2b); - if (defsalt.length) krb5_xfree(defsalt.data); + if (defsalt.length) free(defsalt.data); return(retval); } @@ -1472,7 +1472,7 @@ krb5_error_code pa_sam_2(krb5_context context, if (retval) { krb5_free_sam_challenge_2(context, sc2); krb5_free_sam_challenge_2_body(context, sc2b); - if (defsalt.length) krb5_xfree(defsalt.data); + if (defsalt.length) free(defsalt.data); return(retval); } @@ -1483,14 +1483,14 @@ krb5_error_code pa_sam_2(krb5_context context, if (retval) { krb5_free_sam_challenge_2(context, sc2); krb5_free_sam_challenge_2_body(context, sc2b); - if (defsalt.length) krb5_xfree(defsalt.data); + if (defsalt.length) free(defsalt.data); return(retval); } krb5_free_keyblock_contents(context, &tmp_kb); } if (defsalt.length) - krb5_xfree(defsalt.data); + free(defsalt.data); } else { /* as_key = string_to_key(SAD) */ @@ -1505,7 +1505,7 @@ krb5_error_code pa_sam_2(krb5_context context, &response_data, salt, as_key); if (defsalt.length) - krb5_xfree(defsalt.data); + free(defsalt.data); if (retval) { krb5_free_sam_challenge_2(context, sc2); diff --git a/src/lib/krb5/krb/rd_cred.c b/src/lib/krb5/krb/rd_cred.c index 5e159ab80..48637450d 100644 --- a/src/lib/krb5/krb/rd_cred.c +++ b/src/lib/krb5/krb/rd_cred.c @@ -42,10 +42,10 @@ decrypt_credencdata(krb5_context context, krb5_cred *pcred, cleanup: if (ppart != NULL) { memset(ppart, 0, sizeof(*ppart)); - krb5_xfree(ppart); + free(ppart); } memset(scratch.data, 0, scratch.length); - krb5_xfree(scratch.data); + free(scratch.data); return retval; } @@ -128,7 +128,7 @@ krb5_rd_cred_basic(krb5_context context, krb5_data *pcreddata, goto cleanup; pcur->ticket = *pdata; - krb5_xfree(pdata); + free(pdata); pcur->is_skey = FALSE; @@ -214,10 +214,10 @@ krb5_rd_cred(krb5_context context, krb5_auth_context auth_context, replay.cusec = replaydata.usec; replay.ctime = replaydata.timestamp; if ((retval = krb5_rc_store(context, auth_context->rcache, &replay))) { - krb5_xfree(replay.client); + free(replay.client); goto error; } - krb5_xfree(replay.client); + free(replay.client); } if (auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_DO_SEQUENCE) { diff --git a/src/lib/krb5/krb/rd_priv.c b/src/lib/krb5/krb/rd_priv.c index 66b29b0fa..7d1dbc3ca 100644 --- a/src/lib/krb5/krb/rd_priv.c +++ b/src/lib/krb5/krb/rd_priv.c @@ -141,11 +141,11 @@ cleanup_data:; cleanup_scratch:; memset(scratch.data, 0, scratch.length); - krb5_xfree(scratch.data); + free(scratch.data); cleanup_privmsg:; - krb5_xfree(privmsg->enc_part.ciphertext.data); - krb5_xfree(privmsg); + free(privmsg->enc_part.ciphertext.data); + free(privmsg); return retval; } @@ -239,10 +239,10 @@ krb5_rd_priv(krb5_context context, krb5_auth_context auth_context, replay.cusec = replaydata.usec; replay.ctime = replaydata.timestamp; if ((retval = krb5_rc_store(context, auth_context->rcache, &replay))) { - krb5_xfree(replay.client); + free(replay.client); goto error; } - krb5_xfree(replay.client); + free(replay.client); } if (auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_DO_SEQUENCE) { @@ -265,7 +265,7 @@ krb5_rd_priv(krb5_context context, krb5_auth_context auth_context, return 0; error:; - krb5_xfree(outbuf->data); + free(outbuf->data); outbuf->length = 0; outbuf->data = NULL; diff --git a/src/lib/krb5/krb/rd_req_dec.c b/src/lib/krb5/krb/rd_req_dec.c index 618151100..c618be1ee 100644 --- a/src/lib/krb5/krb/rd_req_dec.c +++ b/src/lib/krb5/krb/rd_req_dec.c @@ -354,10 +354,10 @@ krb5_rd_req_decoded_opt(krb5_context context, krb5_auth_context *auth_context, &rep.msghash); if (!retval) { retval = krb5_rc_store(context, (*auth_context)->rcache, &rep); - krb5_xfree(rep.msghash); + free(rep.msghash); } - krb5_xfree(rep.server); - krb5_xfree(rep.client); + free(rep.server); + free(rep.client); } if (retval) @@ -507,10 +507,10 @@ krb5_rd_req_decoded_opt(krb5_context context, krb5_auth_context *auth_context, cleanup: if (desired_etypes != NULL) - krb5_xfree(desired_etypes); + free(desired_etypes); if (permitted_etypes != NULL && permitted_etypes != (*auth_context)->permitted_etypes) - krb5_xfree(permitted_etypes); + free(permitted_etypes); if (server == &princ_data) krb5_free_default_realm(context, princ_data.realm.data); if (retval) { @@ -706,7 +706,7 @@ decode_etype_list(krb5_context context, if (code == 0) { *desired_etypes = etype_list->etypes; *desired_etypes_len = etype_list->length; - krb5_xfree(etype_list); + free(etype_list); } if (ad_if_relevant != NULL) diff --git a/src/lib/krb5/krb/rd_safe.c b/src/lib/krb5/krb/rd_safe.c index d14d9d428..938b4483d 100644 --- a/src/lib/krb5/krb/rd_safe.c +++ b/src/lib/krb5/krb/rd_safe.c @@ -245,10 +245,10 @@ krb5_rd_safe(krb5_context context, krb5_auth_context auth_context, replay.cusec = replaydata.usec; replay.ctime = replaydata.timestamp; if ((retval = krb5_rc_store(context, auth_context->rcache, &replay))) { - krb5_xfree(replay.client); + free(replay.client); goto error; } - krb5_xfree(replay.client); + free(replay.client); } if (auth_context->auth_context_flags & KRB5_AUTH_CONTEXT_DO_SEQUENCE) { @@ -271,7 +271,7 @@ krb5_rd_safe(krb5_context context, krb5_auth_context auth_context, return 0; error: - krb5_xfree(outbuf->data); + free(outbuf->data); return retval; } diff --git a/src/lib/krb5/krb/recvauth.c b/src/lib/krb5/krb/recvauth.c index 92bcad7a9..ab3e1e48a 100644 --- a/src/lib/krb5/krb/recvauth.c +++ b/src/lib/krb5/krb/recvauth.c @@ -77,7 +77,7 @@ recvauth_common(krb5_context context, if (strcmp(inbuf.data, sendauth_version)) { problem = KRB5_SENDAUTH_BADAUTHVERS; } - krb5_xfree(inbuf.data); + free(inbuf.data); } if (flags & KRB5_RECVAUTH_BADAUTHVERS) problem = KRB5_SENDAUTH_BADAUTHVERS; @@ -94,7 +94,7 @@ recvauth_common(krb5_context context, if (version && !problem) *version = inbuf; else - krb5_xfree(inbuf.data); + free(inbuf.data); /* * OK, now check the problem variable. If it's zero, we're * fine and we can continue. Otherwise, we have to signal an @@ -165,7 +165,7 @@ recvauth_common(krb5_context context, if (!problem) { problem = krb5_rd_req(context, auth_context, &inbuf, server, keytab, &ap_option, ticket); - krb5_xfree(inbuf.data); + free(inbuf.data); } /* @@ -213,7 +213,7 @@ recvauth_common(krb5_context context, retval = krb5_write_message(context, fd, &outbuf); if (outbuf.data) { - krb5_xfree(outbuf.data); + free(outbuf.data); /* We sent back an error, we need cleanup then return */ retval = problem; goto cleanup; @@ -227,7 +227,7 @@ recvauth_common(krb5_context context, return(retval); } retval = krb5_write_message(context, fd, &outbuf); - krb5_xfree(outbuf.data); + free(outbuf.data); } cleanup:; diff --git a/src/lib/krb5/krb/send_tgs.c b/src/lib/krb5/krb/send_tgs.c index 138599804..ab136abb7 100644 --- a/src/lib/krb5/krb/send_tgs.c +++ b/src/lib/krb5/krb/send_tgs.c @@ -103,7 +103,7 @@ krb5_send_tgs_basic(krb5_context context, krb5_data *in_data, krb5_creds *in_cre retval = encode_krb5_ap_req(&request, &toutbuf); *outbuf = *toutbuf; - krb5_xfree(toutbuf); + free(toutbuf); memset(request.authenticator.ciphertext.data, 0, @@ -174,7 +174,7 @@ krb5_send_tgs(krb5_context context, krb5_flags kdcoptions, KRB5_KEYUSAGE_TGS_REQ_AD_SESSKEY, scratch, &tgsreq.authorization_data))) { - krb5_xfree(tgsreq.authorization_data.ciphertext.data); + free(tgsreq.authorization_data.ciphertext.data); krb5_free_data(context, scratch); return retval; } @@ -229,7 +229,7 @@ krb5_send_tgs(krb5_context context, krb5_flags kdcoptions, for (counter = padata; *counter; counter++, i++); combined_padata = malloc((i+2) * sizeof(*combined_padata)); if (!combined_padata) { - krb5_xfree(ap_req_padata.contents); + free(ap_req_padata.contents); retval = ENOMEM; goto send_tgs_error_2; } @@ -240,7 +240,7 @@ krb5_send_tgs(krb5_context context, krb5_flags kdcoptions, } else { combined_padata = (krb5_pa_data **)malloc(2*sizeof(*combined_padata)); if (!combined_padata) { - krb5_xfree(ap_req_padata.contents); + free(ap_req_padata.contents); retval = ENOMEM; goto send_tgs_error_2; } @@ -251,12 +251,12 @@ krb5_send_tgs(krb5_context context, krb5_flags kdcoptions, /* the TGS_REQ is assembled in tgsreq, so encode it */ if ((retval = encode_krb5_tgs_req(&tgsreq, &scratch))) { - krb5_xfree(ap_req_padata.contents); - krb5_xfree(combined_padata); + free(ap_req_padata.contents); + free(combined_padata); goto send_tgs_error_2; } - krb5_xfree(ap_req_padata.contents); - krb5_xfree(combined_padata); + free(ap_req_padata.contents); + free(combined_padata); /* now send request & get response from KDC */ send_again: @@ -297,11 +297,11 @@ send_tgs_error_2:; send_tgs_error_1:; if (ktypes == NULL) - krb5_xfree(tgsreq.ktype); + free(tgsreq.ktype); if (tgsreq.authorization_data.ciphertext.data) { memset(tgsreq.authorization_data.ciphertext.data, 0, tgsreq.authorization_data.ciphertext.length); - krb5_xfree(tgsreq.authorization_data.ciphertext.data); + free(tgsreq.authorization_data.ciphertext.data); } return retval; diff --git a/src/lib/krb5/krb/sendauth.c b/src/lib/krb5/krb/sendauth.c index 35684bebb..85d52f171 100644 --- a/src/lib/krb5/krb/sendauth.c +++ b/src/lib/krb5/krb/sendauth.c @@ -181,12 +181,12 @@ krb5_sendauth(krb5_context context, krb5_auth_context *auth_context, if (inbuf.length) { if (error) { if ((retval = krb5_rd_error(context, &inbuf, error))) { - krb5_xfree(inbuf.data); + free(inbuf.data); goto error_return; } } retval = KRB5_SENDAUTH_REJECTED; - krb5_xfree(inbuf.data); + free(inbuf.data); goto error_return; } @@ -204,11 +204,11 @@ krb5_sendauth(krb5_context context, krb5_auth_context *auth_context, &repl))) { if (repl) krb5_free_ap_rep_enc_part(context, repl); - krb5_xfree(inbuf.data); + free(inbuf.data); goto error_return; } - krb5_xfree(inbuf.data); + free(inbuf.data); /* * If the user wants to look at the AP_REP message, * copy it for him diff --git a/src/lib/krb5/krb/ser_princ.c b/src/lib/krb5/krb/ser_princ.c index a4663c5f8..b04638de0 100644 --- a/src/lib/krb5/krb/ser_princ.c +++ b/src/lib/krb5/krb/ser_princ.c @@ -74,7 +74,7 @@ krb5_principal_size(krb5_context kcontext, krb5_pointer arg, size_t *sizep) if ((principal = (krb5_principal) arg) && !(kret = krb5_unparse_name(kcontext, principal, &fname))) { *sizep += (3*sizeof(krb5_int32)) + strlen(fname); - krb5_xfree(fname); + free(fname); } return(kret); } @@ -111,7 +111,7 @@ krb5_principal_externalize(krb5_context kcontext, krb5_pointer arg, krb5_octet * *buffer = bp; *lenremain = remain; - krb5_xfree(fname); + free(fname); } } } diff --git a/src/lib/krb5/krb/serialize.c b/src/lib/krb5/krb/serialize.c index 9152dba0a..f78bc1618 100644 --- a/src/lib/krb5/krb/serialize.c +++ b/src/lib/krb5/krb/serialize.c @@ -76,7 +76,7 @@ krb5_register_serializer(krb5_context kcontext, const krb5_ser_entry *entry) /* Copy in new entry */ memcpy(&stable[kcontext->ser_ctx_count], entry, sizeof(krb5_ser_entry)); - if (kcontext->ser_ctx) krb5_xfree(kcontext->ser_ctx); + if (kcontext->ser_ctx) free(kcontext->ser_ctx); kcontext->ser_ctx = (void *) stable; kcontext->ser_ctx_count++; } diff --git a/src/lib/krb5/krb/set_realm.c b/src/lib/krb5/krb/set_realm.c index edb72ae7f..9a96cd1ca 100644 --- a/src/lib/krb5/krb/set_realm.c +++ b/src/lib/krb5/krb/set_realm.c @@ -40,7 +40,7 @@ krb5_set_principal_realm(krb5_context context, krb5_principal principal, const c if (!newrealm) return -ENOMEM; - (void) krb5_xfree(krb5_princ_realm(context,principal)->data); + (void) free(krb5_princ_realm(context,principal)->data); krb5_princ_realm(context, principal)->length = length; krb5_princ_realm(context, principal)->data = newrealm; diff --git a/src/lib/krb5/krb/srv_rcache.c b/src/lib/krb5/krb/srv_rcache.c index a426881d4..9da6d45ff 100644 --- a/src/lib/krb5/krb/srv_rcache.c +++ b/src/lib/krb5/krb/srv_rcache.c @@ -93,8 +93,8 @@ krb5_get_server_rcache(krb5_context context, const krb5_data *piece, cleanup: if (rcache) - krb5_xfree(rcache); + free(rcache); if (cachename) - krb5_xfree(cachename); + free(cachename); return retval; } diff --git a/src/lib/krb5/krb/t_ser.c b/src/lib/krb5/krb/t_ser.c index 7c3945323..1776a3f21 100644 --- a/src/lib/krb5/krb/t_ser.c +++ b/src/lib/krb5/krb/t_ser.c @@ -128,7 +128,7 @@ ser_data(int verbose, char *msg, krb5_pointer ctx, krb5_magic dtype) if (verbose) printf("%s: compare succeeded\n", msg); } - krb5_xfree(outrep2); + free(outrep2); } else printf("%s: second externalize returned %d\n", msg, kret); @@ -144,7 +144,7 @@ ser_data(int verbose, char *msg, krb5_pointer ctx, krb5_magic dtype) actx = (krb5_auth_context) nctx; if (actx->i_vector) - krb5_xfree(actx->i_vector); + free(actx->i_vector); } krb5_auth_con_free(ser_ctx, (krb5_auth_context) nctx); break; @@ -164,11 +164,11 @@ ser_data(int verbose, char *msg, krb5_pointer ctx, krb5_magic dtype) eblock = (krb5_encrypt_block *) nctx; #if 0 if (eblock->priv && eblock->priv_size) - krb5_xfree(eblock->priv); + free(eblock->priv); #endif if (eblock->key) krb5_free_keyblock(ser_ctx, eblock->key); - krb5_xfree(eblock); + free(eblock); } break; case KV5M_PRINCIPAL: @@ -184,7 +184,7 @@ ser_data(int verbose, char *msg, krb5_pointer ctx, krb5_magic dtype) } else printf("%s: internalize returned %d\n", msg, kret); - krb5_xfree(outrep); + free(outrep); } else printf("%s: externalize_data returned %d\n", msg, kret); @@ -307,7 +307,7 @@ ser_acontext_test(krb5_context kcontext, int verbose) !(kret = ser_data(verbose, "> Auth context with new vector", (krb5_pointer) actx, KV5M_AUTH_CONTEXT)) && - (krb5_xfree(actx->i_vector), actx->i_vector) && + (free(actx->i_vector), actx->i_vector) && !(kret = krb5_auth_con_setivector(kcontext, actx, (krb5_pointer) print_erep) ) && diff --git a/src/lib/krb5/krb/vfy_increds.c b/src/lib/krb5/krb/vfy_increds.c index f133e2f67..ba4187ea6 100644 --- a/src/lib/krb5/krb/vfy_increds.c +++ b/src/lib/krb5/krb/vfy_increds.c @@ -226,7 +226,7 @@ cleanup: if (authcon) krb5_auth_con_free(context, authcon); if (ap_req.data) - krb5_xfree(ap_req.data); + free(ap_req.data); return(ret); } diff --git a/src/lib/krb5/os/an_to_ln.c b/src/lib/krb5/os/an_to_ln.c index 83bce2bab..b886f17f1 100644 --- a/src/lib/krb5/os/an_to_ln.c +++ b/src/lib/krb5/os/an_to_ln.c @@ -115,13 +115,13 @@ db_an_to_ln(context, dbname, aname, lnsize, lname) db = KDBM_OPEN(dbname, O_RDONLY, 0600); if (!db) { - krb5_xfree(princ_name); + free(princ_name); return KRB5_LNAME_CANTOPEN; } contents = KDBM_FETCH(db, key); - krb5_xfree(princ_name); + free(princ_name); if (contents.dptr == NULL) { retval = KRB5_LNAME_NOTRANS; @@ -583,7 +583,7 @@ rule_an_to_ln(krb5_context context, char *rule, krb5_const_principal aname, cons if (!(selstring = aname_full_to_mapping_name(fprincname))) kret = ENOMEM; } - krb5_xfree(fprincname); + free(fprincname); } if (!kret) { /* @@ -819,9 +819,9 @@ krb5_aname_to_localname(krb5_context context, krb5_const_principal aname, int ln } else kret = ENOMEM; - krb5_xfree(pname); + free(pname); } - krb5_xfree(realm); + free(realm); } return(kret); } diff --git a/src/lib/krb5/os/free_krbhs.c b/src/lib/krb5/os/free_krbhs.c index a10db910c..e7c7116cd 100644 --- a/src/lib/krb5/os/free_krbhs.c +++ b/src/lib/krb5/os/free_krbhs.c @@ -40,6 +40,6 @@ krb5_free_krbhst(krb5_context context, char *const *hostlist) for (cp = hostlist; *cp; cp++) free(*cp); - krb5_xfree(hostlist); + free((char *)hostlist); return 0; } diff --git a/src/lib/krb5/os/full_ipadr.c b/src/lib/krb5/os/full_ipadr.c index c72daa8c9..309c3b57f 100644 --- a/src/lib/krb5/os/full_ipadr.c +++ b/src/lib/krb5/os/full_ipadr.c @@ -53,7 +53,7 @@ krb5_make_full_ipaddr(krb5_context context, krb5_int32 adr, 2*sizeof(temptype) + 2*sizeof(templength); if (!(retaddr->contents = (krb5_octet *)malloc(retaddr->length))) { - krb5_xfree(retaddr); + free(retaddr); return ENOMEM; } marshal = retaddr->contents; diff --git a/src/lib/krb5/os/localaddr.c b/src/lib/krb5/os/localaddr.c index d884b8cd4..100752247 100644 --- a/src/lib/krb5/os/localaddr.c +++ b/src/lib/krb5/os/localaddr.c @@ -1358,7 +1358,7 @@ get_localaddrs (krb5_context context, krb5_address ***addr, int use_profile) int i; if (data.addr_temp) { for (i = 0; i < data.count; i++) - krb5_xfree (data.addr_temp[i]); + free (data.addr_temp[i]); free (data.addr_temp); } if (data.mem_err) diff --git a/src/lib/krb5/os/locate_kdc.c b/src/lib/krb5/os/locate_kdc.c index 4725bf4ab..f10f3af1c 100644 --- a/src/lib/krb5/os/locate_kdc.c +++ b/src/lib/krb5/os/locate_kdc.c @@ -337,7 +337,7 @@ krb5_locate_srv_conf_1(krb5_context context, const krb5_data *realm, error_message(code)); if (code == PROF_NO_SECTION || code == PROF_NO_RELATION) code = KRB5_REALM_UNKNOWN; - krb5_xfree(host); + free(host); return code; } @@ -348,7 +348,7 @@ krb5_locate_srv_conf_1(krb5_context context, const krb5_data *realm, if (count == 0) { profile_free_list(hostlist); - krb5_xfree(host); + free(host); addrlist->naddrs = 0; return 0; } @@ -362,7 +362,7 @@ krb5_locate_srv_conf_1(krb5_context context, const krb5_data *realm, code = profile_get_values(context->profile, realm_srv_names, &masterlist); - krb5_xfree(host); + free(host); if (code == 0) { for (i=0; masterlist[i]; i++) { @@ -383,7 +383,7 @@ krb5_locate_srv_conf_1(krb5_context context, const krb5_data *realm, } } } else { - krb5_xfree(host); + free(host); } /* at this point, if master is non-NULL, then either the master kdc diff --git a/src/lib/krb5/os/read_msg.c b/src/lib/krb5/os/read_msg.c index 47973bbd8..82a257376 100644 --- a/src/lib/krb5/os/read_msg.c +++ b/src/lib/krb5/os/read_msg.c @@ -57,7 +57,7 @@ krb5_read_message(krb5_context context, krb5_pointer fdp, krb5_data *inbuf) return(ENOMEM); } if ((len2 = krb5_net_read(context, fd, buf, ilen)) != ilen) { - krb5_xfree(buf); + free(buf); return((len2 < 0) ? errno : ECONNABORTED); } } diff --git a/src/lib/krb5/os/sn2princ.c b/src/lib/krb5/os/sn2princ.c index cbc6eb1ed..c300e2d42 100644 --- a/src/lib/krb5/os/sn2princ.c +++ b/src/lib/krb5/os/sn2princ.c @@ -187,7 +187,7 @@ krb5_sname_to_principal(krb5_context context, const char *hostname, const char * if (!hrealms[0]) { free(remote_host); - krb5_xfree(hrealms); + free(hrealms); return KRB5_ERR_HOST_REALM_UNKNOWN; } realm = hrealms[0]; diff --git a/src/lib/krb5/rcache/rc_dfl.c b/src/lib/krb5/rcache/rc_dfl.c index 048616208..009edfdad 100644 --- a/src/lib/krb5/rcache/rc_dfl.c +++ b/src/lib/krb5/rcache/rc_dfl.c @@ -334,10 +334,10 @@ krb5_rc_dfl_resolve(krb5_context context, krb5_rcache id, char *name) cleanup: if (t) { if (t->name) - krb5_xfree(t->name); + free(t->name); if (t->h) - krb5_xfree(t->h); - krb5_xfree(t); + free(t->h); + free(t); } return retval; } @@ -523,11 +523,11 @@ krb5_rc_io_fetch(krb5_context context, struct dfl_data *t, errout: if (rep->client) - krb5_xfree(rep->client); + free(rep->client); if (rep->server) - krb5_xfree(rep->server); + free(rep->server); if (rep->msghash) - krb5_xfree(rep->msghash); + free(rep->msghash); rep->client = rep->server = 0; return retval; } diff --git a/src/tests/asn.1/krb5_decode_test.c b/src/tests/asn.1/krb5_decode_test.c index 4afc273c2..68581f103 100644 --- a/src/tests/asn.1/krb5_decode_test.c +++ b/src/tests/asn.1/krb5_decode_test.c @@ -642,7 +642,7 @@ int main(argc, argv) setup(krb5_cred_enc_part,"krb5_cred_enc_part",ktest_make_sample_cred_enc_part); decode_run("enc_cred_part","","7D 82 02 23 30 82 02 1F A0 82 01 DA 30 82 01 D6 30 81 E8 A0 13 30 11 A0 03 02 01 01 A1 0A 04 08 31 32 33 34 35 36 37 38 A1 10 1B 0E 41 54 48 45 4E 41 2E 4D 49 54 2E 45 44 55 A2 1A 30 18 A0 03 02 01 01 A1 11 30 0F 1B 06 68 66 74 73 61 69 1B 05 65 78 74 72 61 A3 07 03 05 00 FE DC BA 98 A4 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A A5 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A A6 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A A7 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A A8 10 1B 0E 41 54 48 45 4E 41 2E 4D 49 54 2E 45 44 55 A9 1A 30 18 A0 03 02 01 01 A1 11 30 0F 1B 06 68 66 74 73 61 69 1B 05 65 78 74 72 61 AA 20 30 1E 30 0D A0 03 02 01 02 A1 06 04 04 12 D0 00 23 30 0D A0 03 02 01 02 A1 06 04 04 12 D0 00 23 30 81 E8 A0 13 30 11 A0 03 02 01 01 A1 0A 04 08 31 32 33 34 35 36 37 38 A1 10 1B 0E 41 54 48 45 4E 41 2E 4D 49 54 2E 45 44 55 A2 1A 30 18 A0 03 02 01 01 A1 11 30 0F 1B 06 68 66 74 73 61 69 1B 05 65 78 74 72 61 A3 07 03 05 00 FE DC BA 98 A4 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A A5 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A A6 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A A7 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A A8 10 1B 0E 41 54 48 45 4E 41 2E 4D 49 54 2E 45 44 55 A9 1A 30 18 A0 03 02 01 01 A1 11 30 0F 1B 06 68 66 74 73 61 69 1B 05 65 78 74 72 61 AA 20 30 1E 30 0D A0 03 02 01 02 A1 06 04 04 12 D0 00 23 30 0D A0 03 02 01 02 A1 06 04 04 12 D0 00 23 A1 03 02 01 2A A2 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A A3 05 02 03 01 E2 40 A4 0F 30 0D A0 03 02 01 02 A1 06 04 04 12 D0 00 23 A5 0F 30 0D A0 03 02 01 02 A1 06 04 04 12 D0 00 23",decode_krb5_enc_cred_part,ktest_equal_enc_cred_part,krb5_free_cred_enc_part); /* free_cred_enc_part does not free the pointer */ - krb5_xfree(var); + free(var); ktest_destroy_principal(&(ref.ticket_info[0]->client)); ktest_destroy_principal(&(ref.ticket_info[0]->server)); ref.ticket_info[0]->flags = 0; @@ -658,7 +658,7 @@ int main(argc, argv) ktest_destroy_address(&(ref.r_address)); decode_run("enc_cred_part","(optionals NULL)","7D 82 01 0E 30 82 01 0A A0 82 01 06 30 82 01 02 30 15 A0 13 30 11 A0 03 02 01 01 A1 0A 04 08 31 32 33 34 35 36 37 38 30 81 E8 A0 13 30 11 A0 03 02 01 01 A1 0A 04 08 31 32 33 34 35 36 37 38 A1 10 1B 0E 41 54 48 45 4E 41 2E 4D 49 54 2E 45 44 55 A2 1A 30 18 A0 03 02 01 01 A1 11 30 0F 1B 06 68 66 74 73 61 69 1B 05 65 78 74 72 61 A3 07 03 05 00 FE DC BA 98 A4 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A A5 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A A6 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A A7 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A A8 10 1B 0E 41 54 48 45 4E 41 2E 4D 49 54 2E 45 44 55 A9 1A 30 18 A0 03 02 01 01 A1 11 30 0F 1B 06 68 66 74 73 61 69 1B 05 65 78 74 72 61 AA 20 30 1E 30 0D A0 03 02 01 02 A1 06 04 04 12 D0 00 23 30 0D A0 03 02 01 02 A1 06 04 04 12 D0 00 23",decode_krb5_enc_cred_part,ktest_equal_enc_cred_part,krb5_free_cred_enc_part); /* free_cred_enc_part does not free the pointer */ - krb5_xfree(var); + free(var); ktest_empty_cred_enc_part(&ref); } @@ -895,8 +895,8 @@ int main(argc, argv) void krb5_ktest_free_alt_method(krb5_context context, krb5_alt_method *val) { if (val->data) - krb5_xfree(val->data); - krb5_xfree(val); + free(val->data); + free(val); } void krb5_ktest_free_pwd_sequence(krb5_context context, @@ -904,7 +904,7 @@ void krb5_ktest_free_pwd_sequence(krb5_context context, { krb5_free_data(context, val->passwd); krb5_free_data(context, val->phrase); - krb5_xfree(val); + free(val); } void krb5_ktest_free_enc_data(krb5_context context, krb5_enc_data *val) -- 2.26.2