summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/libads/krb5_setpw.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/libads/krb5_setpw.c b/source3/libads/krb5_setpw.c
index 254ca7b2a3..ec2ff5afb1 100644
--- a/source3/libads/krb5_setpw.c
+++ b/source3/libads/krb5_setpw.c
@@ -528,7 +528,6 @@ ADS_STATUS ads_krb5_set_password(const char *kdc_host, const char *princ,
DEBUG(1,("Failed to parse kadmin/changepw (%s)\n", error_message(ret)));
return ADS_ERROR_KRB5(ret);
}
- free(princ_name);
/* parse the principal we got as a function argument */
ret = smb_krb5_parse_name(context, princ, &principal);
@@ -537,9 +536,12 @@ ADS_STATUS ads_krb5_set_password(const char *kdc_host, const char *princ,
krb5_free_principal(context, creds.server);
krb5_free_context(context);
DEBUG(1,("Failed to parse %s (%s)\n", princ_name, error_message(ret)));
+ free(princ_name);
return ADS_ERROR_KRB5(ret);
}
+ free(princ_name);
+
/* The creds.server principal takes ownership of this memory.
Remember to set back to original value before freeing. */
orig_realm = *krb5_princ_realm(context, creds.server);