diff options
author | Greg Hudson <ghudson@mit.edu> | 2010-05-13 18:49:20 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2010-05-13 18:49:20 +0000 |
commit | 202383a7defa65fc1bc430343e3bc4dd0da04efd (patch) | |
tree | 41bd8f1c4e401c1b60bf4e917427d56302c4127a /src/lib/krb5/krb | |
parent | aa53b05e76d809172e15c626750d1800a92246dc (diff) | |
download | krb5-202383a7defa65fc1bc430343e3bc4dd0da04efd.tar.gz krb5-202383a7defa65fc1bc430343e3bc4dd0da04efd.tar.xz krb5-202383a7defa65fc1bc430343e3bc4dd0da04efd.zip |
Error handling bug in krb5_init_creds_init()
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
Diffstat (limited to 'src/lib/krb5/krb')
-rw-r--r-- | src/lib/krb5/krb/get_in_tkt.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/krb5/krb/get_in_tkt.c b/src/lib/krb5/krb/get_in_tkt.c index e97984f50..63402ca03 100644 --- a/src/lib/krb5/krb/get_in_tkt.c +++ b/src/lib/krb5/krb/get_in_tkt.c @@ -965,14 +965,15 @@ krb5_init_creds_init(krb5_context context, 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; } |