From e0204ebc7e698cf8f6b43780631760f314255d7e Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Fri, 27 Nov 2009 21:15:53 +0000 Subject: [PATCH] Allow null keys to be referenced (a no-op) for simpler "copying" of keys which might or might not exist. Consistent with allowing freeing of null keys. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23371 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/krb/key.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/crypto/krb/key.c b/src/lib/crypto/krb/key.c index 43d9ce632..15c6205fb 100644 --- a/src/lib/crypto/krb/key.c +++ b/src/lib/crypto/krb/key.c @@ -62,7 +62,8 @@ cleanup: void KRB5_CALLCONV krb5_k_reference_key(krb5_context context, krb5_key key) { - key->refcount++; + if (key) + key->refcount++; } /* Free the memory used by a krb5_key. */ -- 2.26.2