Avoid a null deference if pkinit_init_kdc_req_context() fails to
allocate reqctx.
[ghudson@mit.edu: fixed cleanup handler to work with reqctx == NULL
instead of avoiding the cleanup handler on allocation failure]
reqctx = NULL;
cleanup:
- if (retval && data->pa_type == KRB5_PADATA_PK_AS_REQ) {
+ if (retval && reqctx != NULL && data->pa_type == KRB5_PADATA_PK_AS_REQ) {
pkiDebug("pkinit_verify_padata failed: creating e-data\n");
if (pkinit_create_edata(context, plgctx->cryptoctx, reqctx->cryptoctx,
plgctx->idctx, plgctx->opts, retval, &e_data))