(hdb_get_entry): close and destroy the database later, the
hdb_entry_ex might still contain links to the database that it expects to use. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18267 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -221,16 +221,17 @@ hdb_get_entry(krb5_context context,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
ret = (*db->hdb_fetch)(context, db, principal, HDB_F_DECRYPT, &ent);
|
ret = (*db->hdb_fetch)(context, db, principal, HDB_F_DECRYPT, &ent);
|
||||||
(*db->hdb_close)(context, db);
|
|
||||||
(*db->hdb_destroy)(context, db);
|
|
||||||
|
|
||||||
if(ret == HDB_ERR_NOENTRY)
|
if(ret == HDB_ERR_NOENTRY) {
|
||||||
return KRB5_KT_NOTFOUND;
|
ret = KRB5_KT_NOTFOUND;
|
||||||
else if(ret)
|
goto out;
|
||||||
return ret;
|
}else if(ret)
|
||||||
|
goto out;
|
||||||
|
|
||||||
if(kvno && ent.entry.kvno != kvno) {
|
if(kvno && ent.entry.kvno != kvno) {
|
||||||
hdb_free_entry(context, &ent);
|
hdb_free_entry(context, &ent);
|
||||||
return KRB5_KT_NOTFOUND;
|
ret = KRB5_KT_NOTFOUND;
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
if(enctype == 0)
|
if(enctype == 0)
|
||||||
if(ent.entry.keys.len > 0)
|
if(ent.entry.keys.len > 0)
|
||||||
@@ -248,6 +249,9 @@ hdb_get_entry(krb5_context context,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
hdb_free_entry(context, &ent);
|
hdb_free_entry(context, &ent);
|
||||||
|
out:
|
||||||
|
(*db->hdb_close)(context, db);
|
||||||
|
(*db->hdb_destroy)(context, db);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user