tFree memory used to store the key - sick - sign and check files using ed25519
 (HTM) git clone git://z3bra.org/sick
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 3ea829018da240f2d59c156db537bbbbf06b9d7f
 (DIR) parent 259292d1564073a40c90671ad9b8c2c242b76ad7
 (HTM) Author: Willy Goiffon <contact@z3bra.org>
       Date:   Fri, 25 Aug 2023 08:06:46 +0200
       
       Free memory used to store the key
       
       Diffstat:
         M sick.c                              |       6 +++++-
       
       1 file changed, 5 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/sick.c b/sick.c
       t@@ -280,8 +280,10 @@ sign(FILE *fp, FILE *key)
                        return ERR_NOKEY;
        
                mlen = bufferize(&msg, fp);
       -        if (mlen == 0)
       +        if (mlen == 0) {
       +                free(priv);
                        return ERR_NOMSG;
       +        }
        
                if (verbose)
                        fprintf(stderr, "Signing stream (%llu bytes)\n", mlen);
       t@@ -289,6 +291,8 @@ sign(FILE *fp, FILE *key)
                buf = malloc(mlen + 64);
        
                crypto_sign_ed25519(buf, &slen, msg, mlen, priv);
       +        free(priv);
       +
                memcpy(sig, buf, 64);
                free(buf);