summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-12-02 22:37:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:01 -0500
commit925c95ac9e491ba115bd7ebeb157614cd9bcbe59 (patch)
treef1c4256dc5240760adac97e0513f355adbfb9b79
parent84033c20f0efbe772c8085d4a1eb7d9a9f534a90 (diff)
downloadsamba-925c95ac9e491ba115bd7ebeb157614cd9bcbe59.tar.gz
samba-925c95ac9e491ba115bd7ebeb157614cd9bcbe59.tar.bz2
samba-925c95ac9e491ba115bd7ebeb157614cd9bcbe59.zip
r12035: Fix memory leaks in the KDC.
Andrew Bartlett (This used to be commit b60531b109cf9539a9d58d46436f397346352cee)
-rw-r--r--source4/kdc/hdb-ldb.c3
1 files changed, 3 insertions, 0 deletions
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;
}