1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-23 10:29:58 +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

@ -369,9 +369,12 @@ getkey_disable_caches ()
void void
pubkey_free (struct pubkey *key) pubkey_free (struct pubkey *key)
{ {
xfree (key->pk); if (key)
release_kbnode (key->keyblock); {
xfree (key); xfree (key->pk);
release_kbnode (key->keyblock);
xfree (key);
}
} }
void void