summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/kdc/hdb-ldb.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/source4/kdc/hdb-ldb.c b/source4/kdc/hdb-ldb.c
index 2a2ebb059c..5fd48c49ef 100644
--- a/source4/kdc/hdb-ldb.c
+++ b/source4/kdc/hdb-ldb.c
@@ -295,9 +295,6 @@ static krb5_error_code LDB_message2entry(krb5_context context, HDB *db,
* replace the client principal's realm with the one
* we determine from our records */
- /* don't leak */
- free(*krb5_princ_realm(context, entry_ex->entry.principal));
-
/* this has to be with malloc() */
strdup_realm = strdup(realm);
if (!strdup_realm) {
@@ -305,6 +302,7 @@ static krb5_error_code LDB_message2entry(krb5_context context, HDB *db,
krb5_clear_error_string(context);
goto out;
}
+ free(*krb5_princ_realm(context, entry_ex->entry.principal));
krb5_princ_set_realm(context, entry_ex->entry.principal, &strdup_realm);
}