pull up r18858 from trunk
authorTom Yu <tlyu@mit.edu>
Thu, 30 Nov 2006 21:30:33 +0000 (21:30 +0000)
committerTom Yu <tlyu@mit.edu>
Thu, 30 Nov 2006 21:30:33 +0000 (21:30 +0000)
 r18858@cathode-dark-space:  coffman | 2006-11-21 09:37:11 -0500
 ticket: new
 subject: free error message when freeing context
 Target_Version: 1.6
 Tags: pullup

 Call krb5_clear_error_message() to free any allocated error message
 before freeing the context.

 The condition that triggered this was a plugin library which fails to
 load because of unresolved references.  It appears dlopen() on Linux
 leaks four bytes for each failing library in this situation.

ticket: 4841
version_fixed: 1.6
component: krb5-libs

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@18884 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/init_ctx.c

index 5ce00169a3488bd49c67893c217e0b20207e006c..ad924b73ba53ee8f91750c036a4eec86f933500d 100644 (file)
@@ -272,6 +272,8 @@ krb5_free_context(krb5_context ctx)
          ctx->ser_ctx = 0;
      }
 
+     krb5_clear_error_message(ctx);
+
      ctx->magic = 0;
      free(ctx);
 }