diff options
author | Swen Schillig <swen@linux.ibm.com> | 2018-11-21 12:05:24 +0100 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2018-11-22 08:22:18 +0100 |
commit | 7f902798a7f43ea84fb7757ea6b917a4717f99e0 (patch) | |
tree | a5fb64a7a36875ff108bf5290b09b9d1286249f6 /source3/libads | |
parent | 1295e2b754da6aeb1b5d2c6b07c8cc9afbba21f9 (diff) | |
download | samba-7f902798a7f43ea84fb7757ea6b917a4717f99e0.tar.gz |
s3: Free principal if smb_krb5_principal_get_realm() fails
If smb_krb5_principal_get_realm() fails, procesing is aborted and
resources have to be free'd. In this context free'ing the principal
was missing.
Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3/libads')
-rw-r--r-- | source3/libads/krb5_setpw.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source3/libads/krb5_setpw.c b/source3/libads/krb5_setpw.c index 8f9098853b9..94dd8eefc92 100644 --- a/source3/libads/krb5_setpw.c +++ b/source3/libads/krb5_setpw.c @@ -221,6 +221,7 @@ static ADS_STATUS ads_krb5_chg_password(const char *kdc_host, /* We have to obtain an INITIAL changepw ticket for changing password */ if (asprintf(&chpw_princ, "kadmin/changepw@%s", realm) == -1) { + krb5_free_principal(context, princ); krb5_get_init_creds_opt_free(context, opts); smb_krb5_free_addresses(context, addr); krb5_free_context(context); |