Skip to content

Commit

Permalink
auth/credentials: Add NULL check in free_mccache()
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Schneider <[email protected]>
Reviewed-by: Stefan Metzmacher <[email protected]>
  • Loading branch information
cryptomilk authored and metze-samba committed Dec 20, 2016
1 parent d1ad71e commit c406bf6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion auth/credentials/credentials_krb5.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c406bf6

Please sign in to comment.