X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/e4a509b8174c8b2cfc0a084b78c9c7b7d08b624b..ef13e9a46baaa347014ac236f36a2536f055b108:/catcrypt.c diff --git a/catcrypt.c b/catcrypt.c index 967730a..4c343a4 100644 --- a/catcrypt.c +++ b/catcrypt.c @@ -313,6 +313,7 @@ static int encrypt(int argc, char *argv[]) freeenc(e); if (s) freesig(s); freekem(km); + if (fp != stdin) fclose(fp); if (of) fclose(ofp); key_close(&kf); dstr_destroy(&d); @@ -459,6 +460,7 @@ static int decrypt(int argc, char *argv[]) key_fulltag(sk, &d); printf("INFO good-signature %s\n", d.buf); } + freesig(s); } else if (verb) printf("INFO no-signature\n"); @@ -499,6 +501,7 @@ static int decrypt(int argc, char *argv[]) printf("FAIL bad ciphertext chunk: authentication failure\n"); exit(EXIT_FAILURE); } + GH_DESTROY(h); if (!BLEFT(&b)) break; GC_DECRYPT(c, BCUR(&b), BCUR(&b), BLEFT(&b)); @@ -541,6 +544,7 @@ static int decrypt(int argc, char *argv[]) GC_DESTROY(cx); GM_DESTROY(m); freekem(km); + if (fp != stdin) fclose(fp); if (of) fclose(ofp); key_close(&kf); dstr_destroy(&d);