From: Andreas Schneider Date: Thu, 9 Aug 2018 14:02:16 +0000 (+0200) Subject: s3:libads: Fix memory leaks in ads_krb5_chg_password() X-Git-Tag: ldb-1.5.0~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbdbd4875ecac3e7334750f46f1f494b7afe6628;p=thirdparty%2Fsamba.git s3:libads: Fix memory leaks in ads_krb5_chg_password() Found by covscan. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13567 Pair-Programmed-With: Justin Stephenson Signed-off-by: Andreas Schneider Signed-off-by: Justin Stephenson Reviewed-by: Jeremy Allison --- diff --git a/source3/libads/krb5_setpw.c b/source3/libads/krb5_setpw.c index bc96ac603b1..0418fec5ad3 100644 --- a/source3/libads/krb5_setpw.c +++ b/source3/libads/krb5_setpw.c @@ -224,6 +224,7 @@ static ADS_STATUS ads_krb5_chg_password(const char *kdc_host, krb5_get_init_creds_opt_free(context, opts); krb5_free_context(context); free(realm); + smb_krb5_free_addresses(context, addr); DEBUG(1,("ads_krb5_chg_password: asprintf fail\n")); return ADS_ERROR_NT(NT_STATUS_NO_MEMORY); } @@ -234,6 +235,7 @@ static ADS_STATUS ads_krb5_chg_password(const char *kdc_host, kerb_prompter, NULL, 0, chpw_princ, opts); krb5_get_init_creds_opt_free(context, opts); + smb_krb5_free_addresses(context, addr); SAFE_FREE(chpw_princ); SAFE_FREE(password);