summaryrefslogtreecommitdiff
path: root/cipher/mac.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2014-09-29 17:34:28 +0200
committerWerner Koch <wk@gnupg.org>2014-09-30 12:38:47 +0200
commit51dae8c8c4b63bb5e1685cbd8722e35342524737 (patch)
treee42f00c1e14598ad8202f5d89b91b292c38ff1a3 /cipher/mac.c
parent8b960a807d168000d2690897a7634bd384ac1346 (diff)
downloadlibgcrypt-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.c3
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);
}