1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-10 13:04:23 +01:00

gpg: Add standard free() semantic to pubkey_free.

* g10/getkey.c (pubkey_free): Check for NULL arg.
--

We don't like surprises ;-)

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2015-12-23 15:17:50 +01:00
parent ef7b7e9160
commit 04c9cddda9
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -368,11 +368,14 @@ getkey_disable_caches ()
void void
pubkey_free (struct pubkey *key) pubkey_free (struct pubkey *key)
{
if (key)
{ {
xfree (key->pk); xfree (key->pk);
release_kbnode (key->keyblock); release_kbnode (key->keyblock);
xfree (key); xfree (key);
} }
}
void void
pubkeys_free (struct pubkey *keys) pubkeys_free (struct pubkey *keys)