summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2009-04-10 19:51:53 +0000
committerGreg Hudson <ghudson@mit.edu>2009-04-10 19:51:53 +0000
commit0054540d441eaf6bbb2a8cc993df26b70d68161b (patch)
tree2ee19206207f575aecae263413c4c3dcb3943ad1 /src
parentd468cfbb7977568553aa8e9ed90cc03eda208dd0 (diff)
downloadkrb5-0054540d441eaf6bbb2a8cc993df26b70d68161b.tar.gz
krb5-0054540d441eaf6bbb2a8cc993df26b70d68161b.tar.xz
krb5-0054540d441eaf6bbb2a8cc993df26b70d68161b.zip
Check the return value of krb5_timeofday in krb5int_populate_gic_opt.
Also initialize krb5int_populate_gic_opt's output variable. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22190 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/lib/krb5/krb/gic_pwd.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/krb5/krb/gic_pwd.c b/src/lib/krb5/krb/gic_pwd.c
index f319c3540c..3a3f09d14b 100644
--- a/src/lib/krb5/krb/gic_pwd.c
+++ b/src/lib/krb5/krb/gic_pwd.c
@@ -416,6 +416,7 @@ krb5_error_code krb5int_populate_gic_opt (
krb5_get_init_creds_opt *opt;
krb5_error_code retval;
+ *opte = NULL;
retval = krb5_get_init_creds_opt_alloc(context, &opt);
if (retval)
return(retval);
@@ -439,12 +440,17 @@ krb5_error_code krb5int_populate_gic_opt (
krb5_get_init_creds_opt_set_proxiable(opt, 1);
else krb5_get_init_creds_opt_set_proxiable(opt, 0);
if (creds && creds->times.endtime) {
- krb5_timeofday(context, &starttime);
+ retval = krb5_timeofday(context, &starttime);
+ if (retval)
+ goto cleanup;
if (creds->times.starttime) starttime = creds->times.starttime;
krb5_get_init_creds_opt_set_tkt_life(opt, creds->times.endtime - starttime);
}
return krb5int_gic_opt_to_opte(context, opt, opte, 0,
"krb5int_populate_gic_opt");
+cleanup:
+ krb5_get_init_creds_opt_free(context, opt);
+ return retval;
}
/*