diff options
author | Greg Hudson <ghudson@mit.edu> | 2009-11-27 21:15:53 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2009-11-27 21:15:53 +0000 |
commit | e0204ebc7e698cf8f6b43780631760f314255d7e (patch) | |
tree | a0847c4128b9de3ced8ae6ef93c7c104653fafa4 /src/lib/crypto/krb | |
parent | a321d7151f1b2d324b92884c068e5280708b21ef (diff) | |
download | krb5-e0204ebc7e698cf8f6b43780631760f314255d7e.tar.gz krb5-e0204ebc7e698cf8f6b43780631760f314255d7e.tar.xz krb5-e0204ebc7e698cf8f6b43780631760f314255d7e.zip |
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
Diffstat (limited to 'src/lib/crypto/krb')
-rw-r--r-- | src/lib/crypto/krb/key.c | 3 |
1 files changed, 2 insertions, 1 deletions
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. */ |