From: Greg Hudson Date: Fri, 17 Sep 2010 15:52:23 +0000 (+0000) Subject: In kinit_kdb_init(), ensure that we don't return an error with the X-Git-Tag: krb5-1.9-beta1~84 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5caa3b093619c89f0ea6ff50c2cd5b8e9469502c;p=krb5.git In kinit_kdb_init(), ensure that we don't return an error with the old, freed value of *pcontext still there--that would result in a double free. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24326 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/clients/kinit/kinit_kdb.c b/src/clients/kinit/kinit_kdb.c index f2011a6bf..7a2c2b446 100644 --- a/src/clients/kinit/kinit_kdb.c +++ b/src/clients/kinit/kinit_kdb.c @@ -52,8 +52,10 @@ kinit_kdb_init(krb5_context *pcontext, char *realm) kadm5_config_params config; krb5_error_code retval = 0; - if (*pcontext) + if (*pcontext) { krb5_free_context(*pcontext); + *pcontext = NULL; + } memset(&config, 0, sizeof config); retval = kadm5_init_krb5_context(pcontext); if (retval)