hdb: decorate HDB_entry with context member
Decorate HDB_entry with context and move free_entry callback into HDB structure itself. Requires updating hdb_free_entry() signature to include HDB parameter. A follow-up commit will consolidate hdb_entry_ex (which has a single hdb_entry member) into hdb_entry.
This commit is contained in:
@@ -104,12 +104,12 @@ NDBM_seq(krb5_context context, HDB *db,
|
||||
if (db->hdb_master_key_set && (flags & HDB_F_DECRYPT)) {
|
||||
ret = hdb_unseal_keys (context, db, &entry->entry);
|
||||
if (ret)
|
||||
hdb_free_entry (context, entry);
|
||||
hdb_free_entry (context, db, entry);
|
||||
}
|
||||
if (ret == 0 && entry->entry.principal == NULL) {
|
||||
entry->entry.principal = malloc (sizeof(*entry->entry.principal));
|
||||
if (entry->entry.principal == NULL) {
|
||||
hdb_free_entry (context, entry);
|
||||
hdb_free_entry (context, db, entry);
|
||||
ret = ENOMEM;
|
||||
krb5_set_error_message(context, ret, "malloc: out of memory");
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user