Fix double free on error.
authorNIIBE Yutaka <gniibe@fsij.org>
Thu, 15 Oct 2015 02:28:54 +0000 (11:28 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Thu, 15 Oct 2015 02:28:54 +0000 (11:28 +0900)
* src/hmac256.c (_gcry_hmac256_finalize): Don't free HD.

src/hmac256.c

index 94a26da..6b62ed3 100644 (file)
@@ -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);