diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2015-10-15 11:28:54 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2015-10-15 11:28:54 +0900 |
commit | 1c6d2698a84e4bf82735287c1d64954bfc1a1982 (patch) | |
tree | ed9ce1cd3936991b6fe7f6e0602a430a86405353 | |
parent | 813565a07ca575c87e1252c6ed26018653ecd338 (diff) | |
download | libgcrypt-1c6d2698a84e4bf82735287c1d64954bfc1a1982.tar.gz |
Fix double free on error.
* src/hmac256.c (_gcry_hmac256_finalize): Don't free HD.
-rw-r--r-- | src/hmac256.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/hmac256.c b/src/hmac256.c index 94a26da4..6b62ed39 100644 --- a/src/hmac256.c +++ b/src/hmac256.c @@ -426,10 +426,8 @@ _gcry_hmac256_finalize (hmac256_context_t hd, size_t *r_dlen) tmphd = _gcry_hmac256_new (NULL, 0); if (!tmphd) - { - free (hd); - return NULL; - } + return NULL; + _gcry_hmac256_update (tmphd, hd->opad, 64); _gcry_hmac256_update (tmphd, hd->buf, 32); finalize (tmphd); |