Mailing List Archive

[PATCH] hmac: Fix memory leak
* src/hmac.c: Release HMAC256 context

--

LeakSanitizer marks the allocation of this context as leaked. Since the
hmac binary is used during the build with --enable-hmac-binary-check,
this fails the build with AddressSanitizer/LeakSanitizer.

Signed-off-by: Clemens Lang <cllang@redhat.com>
---
src/hmac256.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/hmac256.c b/src/hmac256.c
index bd089b79..899e6d15 100644
--- a/src/hmac256.c
+++ b/src/hmac256.c
@@ -780,6 +780,7 @@ main (int argc, char **argv)
pgm, strerror (errno));
exit (1);
}
+ _gcry_hmac256_release (hd);
if (use_stdin)
break;
}
--
2.34.1


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@lists.gnupg.org
https://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: [PATCH] hmac: Fix memory leak [ In reply to ]
Clemens Lang wrote:
> * src/hmac.c: Release HMAC256 context

Thank you. Applied master and 1.10 branch.
--

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@lists.gnupg.org
https://lists.gnupg.org/mailman/listinfo/gcrypt-devel