From: Swen Schillig Date: Wed, 21 Nov 2018 11:05:24 +0000 (+0100) Subject: s3: Free principal if smb_krb5_principal_get_realm() fails X-Git-Tag: tdb-1.3.17~678 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f902798a7f43ea84fb7757ea6b917a4717f99e0;p=thirdparty%2Fsamba.git 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 Reviewed-by: Andreas Schneider Reviewed-by: Ralph Boehme --- 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);