diff options
author | Andreas Schneider <asn@samba.org> | 2016-10-01 11:27:54 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2016-12-20 13:52:09 +0100 |
commit | ae5e654f88539b3b7ab55ae11b048479523138aa (patch) | |
tree | 3cdd6ecbc50d55a8f6fd6a1c278d05c6f1241bbc | |
parent | c406bf6cd6907b43301752169054c0d30b1f8544 (diff) | |
download | samba-ae5e654f88539b3b7ab55ae11b048479523138aa.tar.gz |
auth/credentials: Add NULL check to free_dccache()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | auth/credentials/credentials_krb5.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/auth/credentials/credentials_krb5.c b/auth/credentials/credentials_krb5.c index 7b1470a96a9..ca62e30ef73 100644 --- a/auth/credentials/credentials_krb5.c +++ b/auth/credentials/credentials_krb5.c @@ -52,8 +52,13 @@ static int free_mccache(struct ccache_container *ccc) } /* Free a disk-based ccache */ -static int free_dccache(struct ccache_container *ccc) { - krb5_cc_close(ccc->smb_krb5_context->krb5_context, ccc->ccache); +static int free_dccache(struct ccache_container *ccc) +{ + if (ccc->ccache != NULL) { + krb5_cc_close(ccc->smb_krb5_context->krb5_context, + ccc->ccache); + ccc->ccache = NULL; + } return 0; } |