summaryrefslogtreecommitdiff
path: root/source4/kdc/hdb-ldb.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/kdc/hdb-ldb.c')
-rw-r--r--source4/kdc/hdb-ldb.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/source4/kdc/hdb-ldb.c b/source4/kdc/hdb-ldb.c
index c1ed262f7d..cc354af9e9 100644
--- a/source4/kdc/hdb-ldb.c
+++ b/source4/kdc/hdb-ldb.c
@@ -799,27 +799,21 @@ static krb5_error_code LDB_fetch(krb5_context context, HDB *db,
if (flags & HDB_F_GET_CLIENT) {
ret = LDB_fetch_client(context, db, mem_ctx, principal, flags, entry_ex);
- if (ret != HDB_ERR_NOENTRY) {
- talloc_free(mem_ctx);
- return ret;
- }
+ if (ret != HDB_ERR_NOENTRY) goto done;
}
if (flags & HDB_F_GET_SERVER) {
ret = LDB_fetch_server(context, db, mem_ctx, principal, flags, entry_ex);
- if (ret != HDB_ERR_NOENTRY) {
- return ret;
- }
+ if (ret != HDB_ERR_NOENTRY) goto done;
ret = LDB_fetch_krbtgt(context, db, mem_ctx, principal, flags, entry_ex);
- if (ret != HDB_ERR_NOENTRY) {
- return ret;
- }
+ if (ret != HDB_ERR_NOENTRY) goto done;
}
if (flags & HDB_F_GET_KRBTGT) {
ret = LDB_fetch_krbtgt(context, db, mem_ctx, principal, flags, entry_ex);
- if (ret != HDB_ERR_NOENTRY) {
- return ret;
- }
+ if (ret != HDB_ERR_NOENTRY) goto done;
}
+
+done:
+ talloc_free(mem_ctx);
return ret;
}