summaryrefslogtreecommitdiff
path: root/source4/kdc
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-05-23 05:14:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:30 -0500
commit8d130005a1d124d6d534a36be9de79e988c63e14 (patch)
treee444327920b4dc2567c1fc58ef69a5ef71fe3c55 /source4/kdc
parent97d489b21c692815adc4849538a5db7340439e7f (diff)
downloadsamba-8d130005a1d124d6d534a36be9de79e988c63e14.tar.gz
samba-8d130005a1d124d6d534a36be9de79e988c63e14.tar.bz2
samba-8d130005a1d124d6d534a36be9de79e988c63e14.zip
r15830: fixed two kdc memory leaks
(This used to be commit cc290ece92196d2bdf39eaa9d3bb4a0af6ec782c)
Diffstat (limited to 'source4/kdc')
-rw-r--r--source4/kdc/hdb-ldb.c20
-rw-r--r--source4/kdc/kdc.c2
2 files changed, 8 insertions, 14 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;
}
diff --git a/source4/kdc/kdc.c b/source4/kdc/kdc.c
index 4ce17a8718..10e0764e23 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);