Only release keys if they are allocated
This commit is contained in:
@@ -2203,13 +2203,15 @@ _krb5_get_init_creds_opt_free_pkinit(krb5_get_init_creds_opt *opt)
|
|||||||
ctx = opt->opt_private->pk_init_ctx;
|
ctx = opt->opt_private->pk_init_ctx;
|
||||||
switch (ctx->keyex) {
|
switch (ctx->keyex) {
|
||||||
case USE_DH:
|
case USE_DH:
|
||||||
DH_free(ctx->u.dh);
|
if (ctx->u.dh)
|
||||||
|
DH_free(ctx->u.dh);
|
||||||
break;
|
break;
|
||||||
case USE_RSA:
|
case USE_RSA:
|
||||||
break;
|
break;
|
||||||
case USE_ECDH:
|
case USE_ECDH:
|
||||||
#ifdef HAVE_OPENSSL
|
#ifdef HAVE_OPENSSL
|
||||||
EC_KEY_free(ctx->u.eckey);
|
if (ctx->u.eckey)
|
||||||
|
EC_KEY_free(ctx->u.eckey);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user