From 925c95ac9e491ba115bd7ebeb157614cd9bcbe59 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 2 Dec 2005 22:37:07 +0000 Subject: r12035: Fix memory leaks in the KDC. Andrew Bartlett (This used to be commit b60531b109cf9539a9d58d46436f397346352cee) --- source4/kdc/hdb-ldb.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4') diff --git a/source4/kdc/hdb-ldb.c b/source4/kdc/hdb-ldb.c index 5820ba1330..8d9517e827 100644 --- a/source4/kdc/hdb-ldb.c +++ b/source4/kdc/hdb-ldb.c @@ -704,6 +704,7 @@ static krb5_error_code LDB_fetch_ex(krb5_context context, HDB *db, unsigned flag nt_status = sam_get_results_principal((struct ldb_context *)db->hdb_db, mem_ctx, principal_string, &msg, &realm_ref_msg); + free(principal_string); if (NT_STATUS_EQUAL(nt_status, NT_STATUS_NO_SUCH_USER)) { return HDB_ERR_NOENTRY; } else if (NT_STATUS_EQUAL(nt_status, NT_STATUS_NO_MEMORY)) { @@ -785,6 +786,7 @@ static krb5_error_code LDB_fetch_ex(krb5_context context, HDB *db, unsigned flag mem_ctx, user_dn, &msg, krb5_attrs); if (ldb_ret != 1) { + talloc_free(mem_ctx); return HDB_ERR_NOENTRY; } @@ -793,6 +795,7 @@ static krb5_error_code LDB_fetch_ex(krb5_context context, HDB *db, unsigned flag "ncName=%s", ldb_dn_linearize(mem_ctx, domain_dn)); if (ldb_ret != 1) { + talloc_free(mem_ctx); return HDB_ERR_NOENTRY; } -- cgit