diff options
author | Werner Koch <wk@gnupg.org> | 2014-09-29 17:34:28 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2014-09-30 12:38:47 +0200 |
commit | 51dae8c8c4b63bb5e1685cbd8722e35342524737 (patch) | |
tree | e42f00c1e14598ad8202f5d89b91b292c38ff1a3 /cipher/mac.c | |
parent | 8b960a807d168000d2690897a7634bd384ac1346 (diff) | |
download | libgcrypt-51dae8c8c4b63bb5e1685cbd8722e35342524737.tar.gz |
mac: Fix gcry_mac_close to allow for a NULL handle.
* cipher/mac.c (_gcry_mac_close): Check for NULL.
--
We always allow this for easier cleanup. actually the docs already
tell that this is allowed.
Diffstat (limited to 'cipher/mac.c')
-rw-r--r-- | cipher/mac.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cipher/mac.c b/cipher/mac.c index 30117b9e..e5131ed8 100644 --- a/cipher/mac.c +++ b/cipher/mac.c @@ -336,7 +336,8 @@ _gcry_mac_open (gcry_mac_hd_t * h, int algo, unsigned int flags, void _gcry_mac_close (gcry_mac_hd_t hd) { - mac_close (hd); + if (hd) + mac_close (hd); } |