I know you mentioned the issues in tests are not interesting, but we run coverity on every build and shoveling through the dozens of warning with every build is annoying so I tried to fix the most obvious memory leaks and copy&paste error that I noticed. All changes should be clear. If not, I will try to clarify.
the commits are also available in the gitlab mirror:
https://gitlab.com/redhat-crypto/libgcrypt/libgcrypt-mirror/-/merge_requests/2