From: Greg Hudson Date: Fri, 10 Apr 2009 19:51:53 +0000 (+0000) Subject: Check the return value of krb5_timeofday in krb5int_populate_gic_opt. X-Git-Tag: krb5-1.8-alpha1~551 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0054540d441eaf6bbb2a8cc993df26b70d68161b;p=krb5.git 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 --- diff --git a/src/lib/krb5/krb/gic_pwd.c b/src/lib/krb5/krb/gic_pwd.c index f319c3540..3a3f09d14 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; } /*