diff options
Diffstat (limited to 'source4/kdc')
-rw-r--r-- | source4/kdc/hdb-ldb.c | 20 | ||||
-rw-r--r-- | source4/kdc/kdc.c | 2 |
2 files changed, 8 insertions, 14 deletions
diff --git a/source4/kdc/hdb-ldb.c b/source4/kdc/hdb-ldb.c index c1ed262f7d4..cc354af9e91 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; } diff --git a/source4/kdc/kdc.c b/source4/kdc/kdc.c index 4ce17a87186..10e0764e233 100644 --- a/source4/kdc/kdc.c +++ b/source4/kdc/kdc.c @@ -127,7 +127,7 @@ static void kdc_recv_handler(struct kdc_socket *kdc_socket) return; } - blob = data_blob_talloc(kdc_socket, NULL, dsize); + blob = data_blob_talloc(tmp_ctx, NULL, dsize); if (blob.data == NULL) { /* hope this is a temporary low memory condition */ talloc_free(tmp_ctx); |