Fix a bug in krb5_init_creds_init() where a freed context could be
returned to the caller in certain error cases.
ticket: 6722
tags: pullup
target_version: 1.8.2
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24020
dc483132-0cff-0310-8789-
dd5450dbe970
krb5_princ_type(context, ctx->request->client) = KRB5_NT_WELLKNOWN;
}
code = restart_init_creds_loop(context, ctx, NULL);
+ if (code)
+ goto cleanup;
*pctx = ctx;
+ ctx = NULL;
cleanup:
- if (code != 0)
- krb5_init_creds_free(context, ctx);
- if (str != NULL)
- free(str);
+ krb5_init_creds_free(context, ctx);
+ free(str);
return code;
}