From a1c87df26077aaaa8cd644c3d5400cbbd61a3379 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Tue, 24 Mar 2015 11:47:58 -0500 Subject: [PATCH] Add guard in krb5_free_creds() Don't call krb5_free_contents() if the creds pointer is NULL. MIT krb5 also has this guard. --- lib/krb5/creds.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/krb5/creds.c b/lib/krb5/creds.c index 78f501b1e..16e3f5780 100644 --- a/lib/krb5/creds.c +++ b/lib/krb5/creds.c @@ -160,8 +160,9 @@ krb5_copy_creds (krb5_context context, KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_free_creds (krb5_context context, krb5_creds *c) { - krb5_free_cred_contents (context, c); - free (c); + if (c != NULL) + krb5_free_cred_contents(context, c); + free(c); return 0; } -- 2.11.4.GIT