Avoid calling krb5_free_context(NULL) 61/13461/2
authorAndrew Deason <adeason@sinenomine.net>
Fri, 1 Feb 2019 22:31:50 +0000 (16:31 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Mon, 4 Feb 2019 04:59:31 +0000 (23:59 -0500)
commit26b1dc036719a588a5cadecb14053bd4079c1f48
treed89b87a4829dd36a181180a63f8935a1b499804a
parent86d04ea70fd2e99606b1d1b5b68d980d92e7a3cd
Avoid calling krb5_free_context(NULL)

Several places in the code currently call krb5_free_context(ctx) in a
cleanup code path, where 'ctx' may or may not be NULL. This is not
guaranteed to be okay, so check for NULL to make sure we don't cause
issues in these code paths.

While we are here cleaning up krb5_free_context() calls, also fix a
few call sites in afscp_util.c that were not calling krb5_free_context
in all error paths.

Change-Id: I881f01bdf94f00079f84c4bd4bcfa58998e51ac9
Reviewed-on: https://gerrit.openafs.org/13461
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/aklog/aklog.c
src/libafscp/afscp_util.c
src/rxgk/rxgk_crypto_rfc3961.c
src/rxkad/ticket5.c