projects
/
gpgme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7eb7b24
)
(gpgme_key_unref): Allow passing NULL like free does.
author
Werner Koch
<wk@gnupg.org>
Wed, 21 Apr 2004 18:14:12 +0000
(18:14 +0000)
committer
Werner Koch
<wk@gnupg.org>
Wed, 21 Apr 2004 18:14:12 +0000
(18:14 +0000)
The rule of least surprise.
gpgme/ChangeLog
patch
|
blob
|
history
gpgme/key.c
patch
|
blob
|
history
diff --git
a/gpgme/ChangeLog
b/gpgme/ChangeLog
index 1abc055a819b0900529be25c20c0b85cf8955a59..3192ad0115510e70561dfeea5dc80680474c9ad1 100644
(file)
--- a/
gpgme/ChangeLog
+++ b/
gpgme/ChangeLog
@@
-1,3
+1,8
@@
+2004-04-21 Werner Koch <wk@gnupg.org>
+
+ * key.c (gpgme_key_unref): Allow passing NULL like free does.
+ The rule of least surprise.
+
2004-04-15 Werner Koch <wk@gnupg.org>
* verify.c (prepare_new_sig, _gpgme_verify_status_handler): Remove
diff --git
a/gpgme/key.c
b/gpgme/key.c
index 05beb114739c0609b4f49d7a7425dc84dd170ce3..4634c2646bb57dca7f901637f048113372c0af34 100644
(file)
--- a/
gpgme/key.c
+++ b/
gpgme/key.c
@@
-304,6
+304,9
@@
gpgme_key_unref (gpgme_key_t key)
gpgme_user_id_t uid;
gpgme_subkey_t subkey;
+ if (!key)
+ return;
+
LOCK (key_ref_lock);
assert (key->_refs > 0);
if (--key->_refs)