diff options
author | Andreas Schneider <asn@samba.org> | 2016-10-01 11:25:44 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2016-12-20 13:52:09 +0100 |
commit | c406bf6cd6907b43301752169054c0d30b1f8544 (patch) | |
tree | 97c0fa7c574c29029248fb3125f5715d95e310bb | |
parent | d1ad71ef9f0fe9379eb396ee38909d28c7797ee9 (diff) | |
download | samba-c406bf6cd6907b43301752169054c0d30b1f8544.tar.gz |
auth/credentials: Add NULL check in free_mccache()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | auth/credentials/credentials_krb5.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/auth/credentials/credentials_krb5.c b/auth/credentials/credentials_krb5.c index 493cfa60104..7b1470a96a9 100644 --- a/auth/credentials/credentials_krb5.c +++ b/auth/credentials/credentials_krb5.c @@ -42,7 +42,11 @@ static void cli_credentials_invalidate_client_gss_creds( /* Free a memory ccache */ static int free_mccache(struct ccache_container *ccc) { - krb5_cc_destroy(ccc->smb_krb5_context->krb5_context, ccc->ccache); + if (ccc->ccache != NULL) { + krb5_cc_destroy(ccc->smb_krb5_context->krb5_context, + ccc->ccache); + ccc->ccache = NULL; + } return 0; } |