krb5: Fix leak in PKINIT client
This commit is contained in:
@@ -2329,6 +2329,8 @@ krb5_get_init_creds_opt_set_pkinit(krb5_context context,
|
|||||||
{
|
{
|
||||||
#ifdef PKINIT
|
#ifdef PKINIT
|
||||||
krb5_error_code ret;
|
krb5_error_code ret;
|
||||||
|
char **freeme1 = NULL;
|
||||||
|
char **freeme2 = NULL;
|
||||||
char *anchors = NULL;
|
char *anchors = NULL;
|
||||||
|
|
||||||
if (opt->opt_private == NULL) {
|
if (opt->opt_private == NULL) {
|
||||||
@@ -2348,16 +2350,13 @@ krb5_get_init_creds_opt_set_pkinit(krb5_context context,
|
|||||||
|
|
||||||
/* XXX implement krb5_appdefault_strings */
|
/* XXX implement krb5_appdefault_strings */
|
||||||
if (pool == NULL)
|
if (pool == NULL)
|
||||||
pool = krb5_config_get_strings(context, NULL,
|
pool = freeme1 = krb5_config_get_strings(context, NULL, "appdefaults",
|
||||||
"appdefaults",
|
"pkinit_pool", NULL);
|
||||||
"pkinit_pool",
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
if (pki_revoke == NULL)
|
if (pki_revoke == NULL)
|
||||||
pki_revoke = krb5_config_get_strings(context, NULL,
|
pki_revoke = freeme2 = krb5_config_get_strings(context, NULL,
|
||||||
"appdefaults",
|
"appdefaults",
|
||||||
"pkinit_revoke",
|
"pkinit_revoke", NULL);
|
||||||
NULL);
|
|
||||||
|
|
||||||
if (x509_anchors == NULL) {
|
if (x509_anchors == NULL) {
|
||||||
krb5_appdefault_string(context, "kinit",
|
krb5_appdefault_string(context, "kinit",
|
||||||
@@ -2378,6 +2377,8 @@ krb5_get_init_creds_opt_set_pkinit(krb5_context context,
|
|||||||
prompter,
|
prompter,
|
||||||
prompter_data,
|
prompter_data,
|
||||||
password);
|
password);
|
||||||
|
krb5_config_free_strings(freeme2);
|
||||||
|
krb5_config_free_strings(freeme1);
|
||||||
free(anchors);
|
free(anchors);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
free(opt->opt_private->pk_init_ctx);
|
free(opt->opt_private->pk_init_ctx);
|
||||||
|
Reference in New Issue
Block a user