(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:
Love Hörnquist Åstrand
2006-10-06 16:53:11 +00:00
parent 2a1dc72246
commit 87a81b3b0d

View File

@@ -221,16 +221,17 @@ hdb_get_entry(krb5_context context,
return ret;
}
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)
return KRB5_KT_NOTFOUND;
else if(ret)
return ret;
if(ret == HDB_ERR_NOENTRY) {
ret = KRB5_KT_NOTFOUND;
goto out;
}else if(ret)
goto out;
if(kvno && ent.entry.kvno != kvno) {
hdb_free_entry(context, &ent);
return KRB5_KT_NOTFOUND;
ret = KRB5_KT_NOTFOUND;
goto out;
}
if(enctype == 0)
if(ent.entry.keys.len > 0)
@@ -248,6 +249,9 @@ hdb_get_entry(krb5_context context,
}
}
hdb_free_entry(context, &ent);
out:
(*db->hdb_close)(context, db);
(*db->hdb_destroy)(context, db);
return ret;
}