1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-25 17:57:42 +03:00

s4:kdc: call krb5_free_keyblock_contents() in free_sdb_key()

This is much clearer than doing it in sdb_free_entry() already.
It also simplifies the next cleanups.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Stefan Metzmacher 2022-02-11 20:56:17 +01:00
parent ff03d88d6e
commit 97dbdb48d8

View File

@ -28,20 +28,6 @@
void sdb_free_entry(struct sdb_entry_ex *ent)
{
struct sdb_key *k;
size_t i;
for (i = 0; i < ent->entry.keys.len; i++) {
k = &ent->entry.keys.val[i];
/*
* Passing NULL as the Kerberos context is intentional here, as
* both Heimdal and MIT libraries don't use the context when
* clearing the keyblocks.
*/
krb5_free_keyblock_contents(NULL, &k->key);
}
free_sdb_entry(&ent->entry);
ZERO_STRUCTP(ent);
}
@ -52,7 +38,12 @@ static void free_sdb_key(struct sdb_key *k)
return;
}
/* keyblock not alloced */
/*
* Passing NULL as the Kerberos context is intentional here, as
* both Heimdal and MIT libraries don't use the context when
* clearing the keyblocks.
*/
krb5_free_keyblock_contents(NULL, &k->key);
if (k->salt) {
smb_krb5_free_data_contents(NULL, &k->salt->salt);