In kinit_kdb_init(), ensure that we don't return an error with the
authorGreg Hudson <ghudson@mit.edu>
Fri, 17 Sep 2010 15:52:23 +0000 (15:52 +0000)
committerGreg Hudson <ghudson@mit.edu>
Fri, 17 Sep 2010 15:52:23 +0000 (15:52 +0000)
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

src/clients/kinit/kinit_kdb.c

index f2011a6bf6936ab264405488261d02bf1c6fa79c..7a2c2b4460c31a7951adf0fb5f340bacfb4ec258 100644 (file)
@@ -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)